@@ -159,7 +159,7 @@ The deployment script is searched as follows:
2. if not found: look for a default `k8s-deploy.sh` in the `$K8S_SCRIPTS_DIR` directory in your project,
3. if not found: the GitLab CI template assumes you're using the template-based deployment policy.
:warning: `k8s-deploy-$environment_type.sh` or `k8s-deploy.sh` needs to be executable, you can add flag execution with: `git update-index --chmod=+x k8s-deploy.sh`
:warning: `k8s-deploy-$environment_type.sh` or `k8s-deploy.sh` need to be executable, you can set the execution flag with: `git update-index --chmod=+x k8s-deploy.sh`
#### 2: template-based deployment
@@ -174,7 +174,7 @@ The template processes the following steps:
2. fallbacks to default `deployment.yml`.
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`
:warning: `k8s-pre-apply.sh` or `k8s-post-apply.sh` need to be executable, you can set the execution flag with: `git update-index --chmod=+x k8s-pre-apply.sh`
#### 3: Kustomize-based deployment
@@ -189,12 +189,13 @@ The template processes the following steps:
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`
:warning: `k8s-pre-apply.sh` or `k8s-post-apply.sh` need to be executable, you can set the execution flag with: `git update-index --chmod=+x k8s-pre-apply.sh`
#### 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).
:warning: `k8s-readiness-check.sh` needs to be executable, you can add flag execution with: `git update-index --chmod=+x k8s-readiness-check.sh`
:warning: `k8s-readiness-check.sh` need to be executable, you can set the execution flag with: `git update-index --chmod=+x k8s-readiness-check.sh`
### Supported cleanup methods
@@ -214,7 +215,7 @@ The a deployment script is searched as follows:
2. if not found: look for a default `k8s-cleanup.sh` in the `$K8S_SCRIPTS_DIR` directory in your project,
3. if not found: the GitLab CI template assumes you're using the template-based cleanup policy.
:warning: `k8s-cleanup-$environment_type.sh` or `k8s-cleanup.sh` needs to be executable, you can add flag execution with: `git update-index --chmod=+x k8s-cleanup.sh`
:warning: `k8s-cleanup-$environment_type.sh` or `k8s-cleanup.sh` need to be executable, you can set the execution flag with: `git update-index --chmod=+x k8s-cleanup.sh`
> TIP: a nice way to implement environment cleanup is to declare the label `app=${environment_name}` on every Kubernetes
> object associated to your environment.
@@ -232,7 +233,7 @@ The template processes the following steps:
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).
:warning: `k8s-pre-cleanup.sh` or `k8s-post-cleanup.sh` needs to be executable, you can add flag execution with: `git update-index --chmod=+x k8s-pre-cleanup.sh`
:warning: `k8s-pre-cleanup.sh` or `k8s-post-cleanup.sh` need to be executable, you can set the execution flag with: `git update-index --chmod=+x k8s-pre-cleanup.sh`
#### 3: Kustomize-based cleanup
@@ -246,7 +247,7 @@ The template processes the following steps:
2. fallbacks to default `kustomization.yaml`.
3. _optionally_ executes the `k8s-post-cleanup.sh` script in your project to perform specific environment post-cleanup (for e.g. delete bound services).
:warning: `k8s-pre-cleanup.sh` or `k8s-post-cleanup.sh` needs to be executable, you can add flag execution with: `git update-index --chmod=+x k8s-pre-cleanup.sh`
:warning: `k8s-pre-cleanup.sh` or `k8s-post-cleanup.sh` need to be executable, you can set the execution flag with: `git update-index --chmod=+x k8s-pre-cleanup.sh`
#### Cleanup job limitations
@@ -385,7 +386,7 @@ The Kubernetes template uses some global configuration used throughout all jobs.
| `scripts-dir` / `K8S_SCRIPTS_DIR` | directory where k8s scripts (hook scripts) are located | `.` _(root project dir)_ |
| `kustomize-enabled` / `K8S_KUSTOMIZE_ENABLED` | Set to `true` to force using [Kustomize](https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/) | _none_ (disabled) |
| `create-namespace` / `K8S_CREATE_NAMESPACE_ENABLED` | Set to `true` to enable automatic namespace creation | `false` |
| `create-namespace-enabled` / `K8S_CREATE_NAMESPACE_ENABLED` | Set to `true` to enable automatic namespace creation | `false` |
| `DOCKER_CONTAINER_STABLE_IMAGE` | Docker image name to use for staging/prod | **has to be defined when not chaining execution from Docker template** |
| `DOCKER_CONTAINER_UNSTABLE_IMAGE` | Docker image name to use for review | **has to be defined when not chaining execution from Docker template** |