fix passes
This commit is contained in:
@@ -25,6 +25,24 @@ spec:
|
|||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
|
env:
|
||||||
|
- name: MARIADB_HOST
|
||||||
|
value: app-mariadb-service
|
||||||
|
- name: MARIADB_USER
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: myapp-mariadb-secret
|
||||||
|
key: mariadb-user
|
||||||
|
- name: MARIADB_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: myapp-mariadb-secret
|
||||||
|
key: mariadb-password
|
||||||
|
- name: MARIADB_DATABASE
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: myapp-mariadb-secret
|
||||||
|
key: mariadb-dbname
|
||||||
---
|
---
|
||||||
|
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
@@ -32,55 +50,53 @@ kind: Deployment
|
|||||||
metadata:
|
metadata:
|
||||||
namespace: myapp
|
namespace: myapp
|
||||||
labels:
|
labels:
|
||||||
app: myapp-psql
|
app: myapp-mariadb
|
||||||
name: myapp-psql
|
name: myapp-mariadb
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: myapp-psql
|
app: myapp-mariadb
|
||||||
strategy:
|
strategy:
|
||||||
type: Recreate
|
type: Recreate
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: myapp-psql
|
app: myapp-mariadb
|
||||||
spec:
|
spec:
|
||||||
hostname: myapp-psql-pod
|
hostname: myapp-mariadb-pod
|
||||||
restartPolicy: Always
|
restartPolicy: Always
|
||||||
containers:
|
containers:
|
||||||
- name: myapp-db
|
- name: myapp-db
|
||||||
image: postgres:12-alpine
|
image: vasyakrg/php-db
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: Always
|
||||||
env:
|
env:
|
||||||
- name: POSTGRES_USER
|
- name: MARIADB_ROOT_PASSWORD
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: myapp-psql-secret
|
name: myapp-mariadb-secret
|
||||||
key: postgress-user
|
key: mariadb-password
|
||||||
- name: POSTGRES_PASSWORD
|
- name: MARIADB_USER
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: myapp-psql-secret
|
name: myapp-mariadb-secret
|
||||||
key: postgress-password
|
key: mariadb-user
|
||||||
- name: POSTGRES_DB
|
- name: MARIADB_PASSWORD
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: myapp-psql-secret
|
name: myapp-mariadb-secret
|
||||||
key: postgress-dbname
|
key: mariadb-password
|
||||||
|
- name: MARIADB_DATABASE
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: myapp-mariadb-secret
|
||||||
|
key: mariadb-dbname
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: vol-myapp-postgres
|
- name: vol-myapp-mariadb
|
||||||
mountPath: /var/lib/postgresql/data
|
mountPath: /var/lib/mysql
|
||||||
subPath: data
|
subPath: data
|
||||||
- name: pgsql-tmpfs
|
|
||||||
mountPath: /run
|
|
||||||
- name: pgsql-tmpfs
|
|
||||||
mountPath: /tmp
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: vol-myapp-postgres
|
- name: vol-myapp-mariadb
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: myapp-db-pvc
|
claimName: myapp-db-pvc
|
||||||
- name: pgsql-tmpfs
|
|
||||||
emptyDir:
|
|
||||||
medium: Memory
|
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
name: myapp-psql-secret
|
name: myapp-mariadb-secret
|
||||||
namespace: myapp
|
namespace: myapp
|
||||||
data:
|
data:
|
||||||
postgress-user: cmVzdHVzZXI=
|
mariadb-user: cmVzdHVzZXI=
|
||||||
postgress-password: dkVIQ1ZuN0NndXdGd0ViZXQySEMxQQ==
|
mariadb-password: dkVIQ1ZuN0NndXdGd0ViZXQySEMxQQ==
|
||||||
postgress-dbname: cmVzdGRi
|
mariadb-dbname: cmVzdGRi
|
||||||
---
|
---
|
||||||
|
@@ -15,12 +15,13 @@ spec:
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: app-postgress-service
|
namespace: myapp
|
||||||
|
name: app-mariadb-service
|
||||||
spec:
|
spec:
|
||||||
type: NodePort
|
type: NodePort
|
||||||
ports:
|
ports:
|
||||||
- name: myapp-postgress-port
|
- name: myapp-mariadb-port
|
||||||
port: 5432
|
port: 3306
|
||||||
selector:
|
selector:
|
||||||
app: myapp-psql
|
app: myapp-mariadb
|
||||||
---
|
---
|
||||||
|
Reference in New Issue
Block a user