-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(namespace): add create namespace stage
- Loading branch information
1 parent
495dc6d
commit 726023c
Showing
4 changed files
with
94 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# | ||
|
||
.base_create_namespace_stage: &base_create_namespace_stage | ||
extends: .base_docker_kube_image_stage | ||
stage: "Registration" | ||
environment: | ||
name: $DEV_ENVIRONMENT_NAME | ||
script: | ||
- echo "Namespace "${K8S_NAMESPACE}" created" | ||
dependencies: [] | ||
before_script: | ||
- *resolve_env_domain | ||
# Skip the job if the namespace exists | ||
- "[[ $(kubectl get namespace ${K8S_NAMESPACE}) ]] && exit ${CI_JOB_SKIP_EXIT_CODE:-0}" | ||
# Or (re)create to ensure new quota are applied | ||
# - kubectl delete namespaces ${K8S_NAMESPACE} || true | ||
# | ||
- kubectl create namespace ${K8S_NAMESPACE} | ||
- kubectl annotate namespace ${K8S_NAMESPACE} field.cattle.io/projectId=${RANCHER_PROJECT_ID} | ||
# | ||
# Fake rancher namespace creation | ||
- kubectl annotate namespace ${K8S_NAMESPACE} field.cattle.io/containerDefaultResourceLimit='{}' | ||
- kubectl annotate namespace ${K8S_NAMESPACE} field.cattle.io/creatorId=gitlab | ||
# Link the namespace to a git branch | ||
- kubectl annotate namespace ${K8S_NAMESPACE} git/branch=${CI_COMMIT_REF_NAME} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# | ||
|
||
.base_docker_helm_image_stage: | ||
extends: .base_docker_kube_image_stage | ||
image: registry.gitlab.factory.social.gouv.fr/socialgouv/docker/helm:0.13.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# | ||
|
||
.base_docker_kubectl_image_stage: | ||
image: registry.gitlab.factory.social.gouv.fr/socialgouv/docker/kubectl:0.13.0 |