This commit is contained in:
2024-02-20 17:15:27 +08:00
committed by huty
parent 6706e1a633
commit 34158042ad
1529 changed files with 177765 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
kubectl apply -f postgres/
kubectl apply -f solution/
![](./solution/adminer.png)

View File

@@ -0,0 +1,29 @@
apiVersion: v1
kind: Service
metadata:
name: adminer-web
spec:
ports:
- port: 8082
targetPort: 8080
selector:
app: adminer-web
type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: adminer-web
spec:
selector:
matchLabels:
app: adminer-web
template:
metadata:
labels:
app: adminer-web
spec:
containers:
- name: web
image: adminer:4.7-standalone
args: ["php", "-S", "0.0.0.0:8080", "-t", "/var/www/html"]

View File

@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: ch04-lab-db-secret
type: Opaque
stringData:
PASSWORD: "kiamol-ch04l4b"

View File

@@ -0,0 +1,42 @@
apiVersion: v1
kind: Service
metadata:
name: ch04-lab-db
spec:
ports:
- port: 5432
targetPort: 5432
selector:
app: ch04-lab-db
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ch04-lab-db
spec:
selector:
matchLabels:
app: ch04-lab-db
template:
metadata:
labels:
app: ch04-lab-db
spec:
containers:
- name: db
image: postgres:11.6-alpine
env:
- name: POSTGRES_PASSWORD_FILE
value: /db-secrets/password
volumeMounts:
- name: secret
mountPath: "/db-secrets"
volumes:
- name: secret
secret:
secretName: ch04-lab-db-secret
defaultMode: 0400
items:
- key: PASSWORD
path: password

View File

@@ -0,0 +1,6 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: adminer-config
data:
ADMINER_DESIGN: "price"

View File

@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: adminer-secret
type: Opaque
stringData:
ADMINER_DEFAULT_SERVER: "ch04-lab-db"

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View File

@@ -0,0 +1,40 @@
apiVersion: v1
kind: Service
metadata:
name: adminer-web
spec:
ports:
- port: 8082
targetPort: 8080
selector:
app: adminer-web
type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: adminer-web
spec:
selector:
matchLabels:
app: adminer-web
template:
metadata:
labels:
app: adminer-web
spec:
containers:
- name: web
image: adminer:4.7-standalone
args: ["php", "-S", "0.0.0.0:8080", "-t", "/var/www/html"]
env:
- name: ADMINER_DESIGN
valueFrom:
configMapKeyRef:
name: adminer-config
key: ADMINER_DESIGN
- name: ADMINER_DEFAULT_SERVER
valueFrom:
secretKeyRef:
name: adminer-secret
key: ADMINER_DEFAULT_SERVER