@@ -145,7 +145,7 @@ The Kubernetes template supports three techniques to deploy your code:
1. script-based deployment,
2. template-based deployment using raw Kubernetes manifests (with [variables substitution](#variables-substitution-mechanism)),
3. template-based deployment using [Kustomization files](https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/).
3. template-based deployment using [Kustomization files](https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/)(with[variables substitution](#variables-substitution-mechanism)).
#### 1: script-based deployment
...
...
@@ -182,15 +182,12 @@ in your project structure, and let the template [`kubectl apply`](https://kubern
The template processes the following steps:
1. _optionally_ executes the `k8s-pre-apply.sh` script in your project to perform specific environment pre-initialization (for e.g. create required services),
2. looks for your Kustomization file, performs variables substitution and [`kubectl apply`](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply) it,
2. looks for your Kustomization file, performs [variables substitution](#variables-substitution-mechanism), generates the manifests with [`kubectl kustomize`](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#kustomize) and [`kubectl apply`](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply) it,
1. looks for an environment-specific [overlay](https://kubectl.docs.kubernetes.io/references/kustomize/glossary/#overlay) file `./$environment_type/kustomization.yaml` (e.g. `./staging/kustomization.yaml ` for staging environment),
2. fallbacks to default `kustomization.yaml`.
3. _optionally_ executes the `k8s-post-apply.sh` script in your project to perform specific environment post-initialization stuff,
:warning: `k8s-pre-apply.sh` or `k8s-post-apply.sh` needs to be executable, you can add flag execution with: `git update-index --chmod=+x k8s-pre-apply.sh`
Variables substitution is performed by the deprecated feature from Kustomize based on `configMapGenerator`, using a non-valuated variable from a config map.
#### Readiness script
After deployment (either script-based or template-based), the GitLab CI template _optionally_ executes the `k8s-readiness-check.sh` hook script to wait & check for the application to be ready (if not found, the template assumes the application was successfully started).
...
...
@@ -228,7 +225,7 @@ In this mode, you mainly let Kubernetes delete all objects from your Kubernetes
The template processes the following steps:
1. _optionally_ executes the `k8s-pre-cleanup.sh` script in your project to perform specific environment pre-cleanup stuff,
2. looks for your Kubernetes deployment file, performs [variables substitution](#using-variables) and [`kubectl delete`](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply) it,
2. looks for your Kubernetes deployment file, performs [variables substitution](#variables-substitution-mechanism) and [`kubectl delete`](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply) it,
1. look for a specific `deployment-$environment_type.yml` in your project (e.g. `deployment-staging.yml` for staging environment),
2. fallbacks to default `deployment.yml`.
3. _optionally_ executes the `k8s-post-cleanup.sh` script in your project to perform specific environment post-cleanup (for e.g. delete bound services).