change some
This commit is contained in:
4
k8s/00-namespace.yaml
Normal file
4
k8s/00-namespace.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: online-back
|
||||
10
k8s/10-postgres-secret.yaml
Normal file
10
k8s/10-postgres-secret.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: main-db-secret
|
||||
namespace: online-back
|
||||
type: Opaque
|
||||
stringData:
|
||||
POSTGRES_USER: bank_admin
|
||||
POSTGRES_PASSWORD: "bank@#23#@_password"
|
||||
POSTGRES_DB: bank_db
|
||||
11
k8s/11-postgres-pvc.yaml
Normal file
11
k8s/11-postgres-pvc.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: main-db-pvc
|
||||
namespace: online-back
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
32
k8s/12-postgres-deployment.yaml
Normal file
32
k8s/12-postgres-deployment.yaml
Normal file
@@ -0,0 +1,32 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: main-db
|
||||
namespace: online-back
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: main-db
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: main-db
|
||||
spec:
|
||||
containers:
|
||||
- name: main-db
|
||||
image: postgres:14.1-alpine
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: main-db-secret
|
||||
volumeMounts:
|
||||
- name: db-storage
|
||||
mountPath: /var/lib/postgresql/data
|
||||
volumes:
|
||||
- name: db-storage
|
||||
persistentVolumeClaim:
|
||||
claimName: main-db-pvc
|
||||
11
k8s/13-postgres-service.yaml
Normal file
11
k8s/13-postgres-service.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: main-db
|
||||
namespace: online-back
|
||||
spec:
|
||||
selector:
|
||||
app: main-db
|
||||
ports:
|
||||
- port: 5432
|
||||
targetPort: 5432
|
||||
9
k8s/20-minio-secret.yaml
Normal file
9
k8s/20-minio-secret.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: main-minio-secret
|
||||
namespace: online-back
|
||||
type: Opaque
|
||||
stringData:
|
||||
MINIO_ROOT_USER: TX3H1H6XTS288QW07S8Z
|
||||
MINIO_ROOT_PASSWORD: FWWspiI4n4LMknnxYCmzFTCY1ObkGiuaU9SNwOCU
|
||||
11
k8s/21-minio-pvc.yaml
Normal file
11
k8s/21-minio-pvc.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: main-minio-pvc
|
||||
namespace: online-back
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
37
k8s/22-minio-deployment.yaml
Normal file
37
k8s/22-minio-deployment.yaml
Normal file
@@ -0,0 +1,37 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: main-minio
|
||||
namespace: online-back
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: main-minio
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: main-minio
|
||||
spec:
|
||||
containers:
|
||||
- name: main-minio
|
||||
image: quay.io/minio/minio
|
||||
args: ["server", "/storage", "--console-address", ":9093"]
|
||||
ports:
|
||||
- containerPort: 9000
|
||||
- containerPort: 9093
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: main-minio-secret
|
||||
env:
|
||||
- name: MINIO_VOLUMES
|
||||
value: "/storage"
|
||||
volumeMounts:
|
||||
- name: minio-storage
|
||||
mountPath: /storage
|
||||
volumes:
|
||||
- name: minio-storage
|
||||
persistentVolumeClaim:
|
||||
claimName: main-minio-pvc
|
||||
15
k8s/23-minio-service.yaml
Normal file
15
k8s/23-minio-service.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: main-minio
|
||||
namespace: online-back
|
||||
spec:
|
||||
selector:
|
||||
app: main-minio
|
||||
ports:
|
||||
- name: api
|
||||
port: 9000
|
||||
targetPort: 9000
|
||||
- name: console
|
||||
port: 9093
|
||||
targetPort: 9093
|
||||
11
k8s/31-app-pvc.yaml
Normal file
11
k8s/31-app-pvc.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: main-app-public-pvc
|
||||
namespace: online-back
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 500Mi
|
||||
33
k8s/32-app-deployment.yaml
Normal file
33
k8s/32-app-deployment.yaml
Normal file
@@ -0,0 +1,33 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: main-server
|
||||
namespace: online-back
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: main-server
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: main-server
|
||||
spec:
|
||||
containers:
|
||||
- name: main-server
|
||||
image: main-app:k8s-lesson
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 5050
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: 5050
|
||||
initialDelaySeconds: 3
|
||||
periodSeconds: 5
|
||||
volumeMounts:
|
||||
- name: public-storage
|
||||
mountPath: /app/public
|
||||
volumes:
|
||||
- name: public-storage
|
||||
persistentVolumeClaim:
|
||||
claimName: main-app-public-pvc
|
||||
11
k8s/33-app-service.yaml
Normal file
11
k8s/33-app-service.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: main-server
|
||||
namespace: online-back
|
||||
spec:
|
||||
selector:
|
||||
app: main-server
|
||||
ports:
|
||||
- port: 5050
|
||||
targetPort: 5050
|
||||
Reference in New Issue
Block a user