config map
back-config
apiVersion: v1
kind: ConfigMap
metadata:
name: back-cm
data:
DB_PASSWORD: 비밀번호
DB_URL: jdbc:mariadb://파드이름.헤드리스서비스이름.네임스페이스이름.svc.cluster.local:3306/데이터베이스이름
DB_USER: 계정이름
JWT_EXPIRED: "1800000"
JWT_SECRET: 토큰시크릿
MAIL_ADDR: 아이디@gmail.com
MAIL_PASSWORD: 메일키
MDB_URL: ip1:27017,ip2:27017,ip3:27017/데이터베이스이름
REPLICA_NAME: Mdb
STATIC_PATH: https://도메인/api/img
UPLOAD_PATH: /mnt
Rollout or Deployment
Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: backend
labels:
type: backend
spec:
replicas: 2
selector:
matchLabels:
type: backend
template:
metadata:
labels:
type: backend
spec:
containers:
- name: 이름
image: 계정/이미지이름:태그
ports:
- containerPort: 8080
envFrom:
- configMapRef:
name: back-cm
volumeMounts:
- name: nfs-volume
mountPath: /mnt
volumes:
- name: nfs-volume
persistentVolumeClaim:
claimName: nfs-pvc
Service
ClusterIP Service
apiVersion: v1
kind: Service
metadata:
name: back-svc
spec:
selector:
type: backend
ports:
- port: 8080
targetPort: 8080
type: ClusterIP