개발용 쿠버네티스 ingress 설정 방법
개발용 쿠버네티스에 서비스 구동 파일
apiVersion: v1
kind: ConfigMap
metadata:
name: cloud-ssevtr-config
namespace: dev
data:
#인증/인가 서비스 URL
SC_AUTH_SERVER_URL: "https://devlogin.softcamp.co.kr/"
#인증/인가 서비스에 등록한 shiedrm-svc의 client ID
SC_AUTH_CLIENT_ID: "144b38de-5cd4-44ac-a389-842d13995f67"
#인증/인가 서비스에 등록한 shiedrm-svc의 client Secret
SC_AUTH_CLIENT_SECRET: "JignJy0pKyYnLSonJyMrJyciJSImKywkKCYpJi0qLCM"
#인증/인가 서비스의 master-tenant Company ID
SC_AUTH_MASTER_COMPANY_ID: "uFhoVIZI-wni6zwDS-E6xGXPqT-m2ms8GWh"
MIP_SHARED_DIR: "/rmswork/"
MIP_SERVICE_URL: "http://mip-restapi.dev.svc.cluster.local"
DOWNLOAD_DIR: "/rmswork/"
SC_LOG_SERVICE_URL: "https://devlog.softcamp.co.kr"
SCSL_KEY_FILE_DIR: "/rmswork/KeyFile/"
##==========================[컨테이너링커 연동 설정]===========================##
CONTAINER_LINKER_SERVICE_URL: "http://127.0.0.1:8181"
##==========================[컨테 이너링커 전용 START]==========================##
##[컨테이너링커 전용] SKMS URL 필수 설정
SKMS_API_URL: "http://cloud-skms-service.dev.svc.cluster.local"
##[컨테이너링커 전용] 서비스 포트
CONTAINER_LINKER_SERVER_PORT: "8181"
##==========================[컨테이너링커 전용 END]==========================##
SC_LICENSE_SERVICE_URL: "https://devlicense.softcamp.co.kr"
## Redis 설정 필수##
SC_COMMON_REDIS_HOST: "localhost"
SC_COMMON_REDIS_PORT: "6379"
SC_COMMON_REDIS_PASSWORD: "Softcamp2023!@#123"
## ZTCA 설정 ##
SC_COMMON_ZTCA_REDIS_USE: "true"
## cloud-api-gateway 설정 ##
MS_GRAPH_BASE_URL: "https://graph.microsoft.com"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: cloud-ssevtr-service
namespace: dev
labels:
app: cloud-ssevtr-service-label
# namespace: cloud-ss-svc
spec:
replicas: 1
selector:
matchLabels:
app: cloud-ssevtr-service-label
template:
metadata:
labels:
app: cloud-ssevtr-service-label
spec:
containers:
- name: cloud-ssevtr-service
image: scr.softcamp.co.kr/saas/cloud-ss-evtr-svc:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
envFrom:
- configMapRef:
name: cloud-ssevtr-config
volumeMounts:
- name: data-cloud-drm-shared
mountPath: /rmswork
resources:
requests:
memory: 2Gi
limits:
memory: 2Gi
##==========================[컨테이너링커 전용 START]==========================##
- name: cloud-containerlinker-service
image: security365acr.azurecr.io/shieldrm/cloud-containerlinker:20221021.2
imagePullPolicy: Always
ports:
- containerPort: 8181
envFrom:
- configMapRef:
name: cloud-ssevtr-config
volumeMounts:
- name: data-cloud-drm-shared
mountPath: /rmswork
resources:
requests:
memory: 2Gi
limits:
memory: 2Gi
##==========================[컨테이너링커 전용 END]==========================##
volumes:
- name: data-cloud-drm-shared
persistentVolumeClaim:
claimName: data-cloud-drm-shared
imagePullSecrets:
- name: security365acr
---
apiVersion: v1
kind: Service
metadata:
name: cloud-ssevtr-service
namespace: dev
spec:
type: ClusterIP
ports:
- name: ssevtr
port: 80
targetPort: 8080
##==========================[컨테이너링커 전용 START]==========================##
- name: containerlinker
port: 8181
targetPort: 8181
##==========================[컨테이너링커 전용 END]==========================##
selector:
app: cloud-ssevtr-service-label
서비스 구동
kubectl apply -f .\cloud-ssevtrCL-service.yaml
서비스 삭제
kubectl delete -f .\cloud-ssevtrCL-service.yaml
ingress rule 설정 파일
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 2048m
nginx.ingress.kubernetes.io/cors-allow-origin: "*"
nginx.ingress.kubernetes.io/cors-allow-methods: "PUT, GET, POST, DELETE, OPTIONS"
nginx.ingress.kubernetes.io/cors-allow-headers: "*"
name: cloud-ssevtr-service-ingress
namespace: dev
spec:
ingressClassName: ingress-nginx-ssevtr
rules:
- host: ssevtr.softcamp.co.kr
http:
paths:
- backend:
service:
name: cloud-ssevtr-service
port:
number: 80
path: /
pathType: Prefix
tls:
- hosts:
- ssevtr.softcamp.co.kr
secretName: ca-key-pair-softcamp
ingress 확인
kubectl get ingress
ingress 설정 방법
kubectl apply -f .\cloud-ssevtr-service-ingress.yaml
설정 삭제
kubectl delete -f .\cloud-ssevtr-service-ingress.yaml