시스템/쿠버네티스

[쿠버네티스] MSA(4) configmap 생성

cbwstar 2024. 1. 25. 10:00
728x90
반응형

1. 환경설정 파일 configmap 생성

vi common-configmap.yaml

apiVersion: v1
kind: ConfigMap
metadata:
  name: common-configmap
  labels:
    env: production
    tier: backend
    app: configmap
    name: common-configmap
data:
  APP_HOME: "/srv/nfs"
  TZ: "Asia/Seoul"

vi backend-comfigmap.yaml

apiVersion: v1
kind: ConfigMap
metadata:
  name: backend-configmap
  labels:
    env: production
    tier: backend
    app: configmap
    name: backend-configmap
data:
  # default namespace 기준
  EUREKA_INSTANCE_HOSTNAME: "discovery.default.svc.cluster.local"
  APIGATEWAY_HOSTNAME: "apigateway.default.svc.cluster.local"
  SPRING_CLOUD_CONFIG_URI: "http://config.default.svc.cluster.local:8888"
  MYSQL_HOSTNAME: "mysql.default.svc.cluster.local"
  RABBITMQ_HOSTNAME: "rabbitmq.default.svc.cluster.local"
  ZIPKIN_HOSTNAME: "zipkin.default.svc.cluster.local"

 

2. 적용

kubectl create -f common-configmap.yaml

kubectl create -f backend-comfigmap.yaml

 

3. 확인

kubectl get configmaps 

728x90
반응형