Here you have the link to a medium post where this example is explained (in Spanish).
- Kubernetes local cluster
- Kustomize
Tree below show how the project looks like and how many environment there are:
.
├── base
│ ├── jobmanager-deployment.yaml
│ ├── jobmanager-service.yaml
│ ├── kustomization.yaml
│ └── taskmanager-deployment.yaml
└── overlays
├── local
│ ├── flink-conf.yaml
│ ├── flinkconfig_patch.yaml
│ ├── healthcheck_patch.yaml
│ └── kustomization.yaml
├── production
│ ├── cpulimit_patch.yaml
│ ├── flink-conf.yaml
│ ├── flinkconfig_patch.yaml
│ ├── healthcheck_patch.yaml
│ ├── kustomization.yaml
│ ├── log4j-console.properties
│ ├── memorylimit_patch.yaml
│ └── replicacount_patch.yaml
└── test
├── cpulimit_patch.yaml
├── flink-conf.yaml
├── flinkconfig_patch.yaml
├── healthcheck_patch.yaml
├── kustomization.yaml
├── memorylimit_patch.yaml
└── replicacount_patch.yaml
First, select which overlay you want to apply: local|test|production
and follow above instruction:
$ kustomize build overlays/production | kubectl apply -f -
Note: check your final YAML definition removing | kubectl apply -f -
from last command.
Check the instalation by number of replicas, for example, in production the number of replicas for taskmanager is 4:
$ kubectl get pods
NAME READY STATUS RESTARTS
flink-jobmanager-79d94d4dc9-67g84 1/1 Running 0
flink-taskmanager-78984c8bc4-zc8h5 1/1 Running 0
flink-taskmanager-78984c8bc4-twp9p 1/1 Running 0
flink-taskmanager-78984c8bc4-jzf2x 1/1 Running 0
flink-taskmanager-78984c8bc4-lbhrw 1/1 Running 0
This presentation is a good point to start understanding Kustomize.