How to set dynamic values with Kubernetes yaml file

前端 未结 13 2019
旧巷少年郎
旧巷少年郎 2020-12-04 16:22

For example, a deployment yaml file:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: guestbook
spec:
  replicas: 2
  template:
    metadata         


        
13条回答
  •  情深已故
    2020-12-04 16:54

    I create a script called kubectl_apply. It loads variables from .env, replace ${CUSTOMVAR} in yml and pass it to kubectl command

      #!/bin/bash
      set -a
      source .env
      set +a
      eval "cat <

提交回复
热议问题