K8s yaml 파일 분할

1 개요[ | ]

k8s yaml 파일 분할
echo 'resources:' > kustomization.yaml
ls !(kustomization).yaml | sed 's/^/- /g' >> kustomization.yaml
mkdir -p output
kubectl kustomize -o output/

2 #[ | ]

root@localhost:/tmp/test1# ls
configmap.yaml  secret.yaml
root@localhost:/tmp/test1# cat configmap.yaml
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: appname
data:
  key: value
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: game-data
data:
  game.properties: |
    enemies=aliens
    lives=3
root@localhost:/tmp/test1# cat secret.yaml
---
apiVersion: v1
kind: Secret
metadata:
  name: secret-basic-auth
type: kubernetes.io/basic-auth
stringData:
  username: admin
  password: t0p-Secret
---
apiVersion: v1
kind: Secret
metadata:
  name: secret-ssh-auth
type: kubernetes.io/ssh-auth
data:
  ssh-privatekey: |
    MIIEpQIBAAKCAQEAulqb/Y ...
root@localhost:/tmp/test1# echo 'resources:' > kustomization.yaml
root@localhost:/tmp/test1# ls !(kustomization).yaml | sed 's/^/- /g' >> kustomization.yaml
root@localhost:/tmp/test1# cat kustomization.yaml
resources:
- configmap.yaml
- secret.yaml
root@localhost:/tmp/test1# ls output/
v1_configmap_appname.yaml    v1_secret_secret-basic-auth.yaml
v1_configmap_game-data.yaml  v1_secret_secret-ssh-auth.yaml

3 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}