From 6bea4b12c5017ed8dec301f2044a3c733138f740 Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Fri, 17 May 2024 10:42:28 +0300 Subject: [PATCH] Updates (#14) * update namespace * update namespace only when unset * update prod --- .k8s/base/deployment.yml | 2 -- .k8s/base/service.yml | 1 - .k8s/prod/application.yml | 3 +-- .k8s/prod/jobs.yml | 1 - .k8s/prod/kustomization.yml | 8 ++++++++ .k8s/staging/application.yml | 3 +-- .k8s/staging/jobs.yml | 1 - .k8s/staging/kustomization.yml | 10 ++++++++-- 8 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.k8s/base/deployment.yml b/.k8s/base/deployment.yml index 5480a7c..efb8c11 100644 --- a/.k8s/base/deployment.yml +++ b/.k8s/base/deployment.yml @@ -2,7 +2,6 @@ apiVersion: apps/v1 kind: Deployment metadata: name: louper-deployment - namespace: louper labels: app: louper spec: @@ -30,7 +29,6 @@ spec: apiVersion: v1 kind: PersistentVolumeClaim metadata: - namespace: louper name: louper-db spec: accessModes: diff --git a/.k8s/base/service.yml b/.k8s/base/service.yml index a25d036..0ecb4fc 100644 --- a/.k8s/base/service.yml +++ b/.k8s/base/service.yml @@ -1,7 +1,6 @@ apiVersion: v1 kind: Service metadata: - namespace: louper name: louper-service spec: type: NodePort diff --git a/.k8s/prod/application.yml b/.k8s/prod/application.yml index a7f6cf5..c4822ae 100644 --- a/.k8s/prod/application.yml +++ b/.k8s/prod/application.yml @@ -2,7 +2,7 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: louper - namespace: louper + namespace: argocd annotations: argocd-image-updater.argoproj.io/image-list: louper=mark3labs/louper-web:latest argocd-image-updater.argoproj.io/louper.update-strategy: digest @@ -16,7 +16,6 @@ spec: targetRevision: master destination: server: 'https://kubernetes.default.svc' - namespace: louper syncPolicy: automated: prune: true diff --git a/.k8s/prod/jobs.yml b/.k8s/prod/jobs.yml index 3a5337f..9a2bdc6 100644 --- a/.k8s/prod/jobs.yml +++ b/.k8s/prod/jobs.yml @@ -1,7 +1,6 @@ apiVersion: batch/v1 kind: Job metadata: - namespace: louper name: github-ci generatedName: build-image-and-push- annotations: diff --git a/.k8s/prod/kustomization.yml b/.k8s/prod/kustomization.yml index 04d2d62..099e6d8 100644 --- a/.k8s/prod/kustomization.yml +++ b/.k8s/prod/kustomization.yml @@ -6,3 +6,11 @@ resources: - namespace.yml - application.yml - jobs.yml +transformers: + - |- + apiVersion: builtin + kind: NamespaceTransformer + metadata: + name: nsTransform + namespace: louper + unsetOnly: true diff --git a/.k8s/staging/application.yml b/.k8s/staging/application.yml index 2a5a6b8..9da3647 100644 --- a/.k8s/staging/application.yml +++ b/.k8s/staging/application.yml @@ -2,7 +2,7 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: louper - namespace: louper-staging + namespace: argocd annotations: argocd-image-updater.argoproj.io/image-list: louper=mark3labs/louper-web:staging-latest argocd-image-updater.argoproj.io/louper.update-strategy: digest @@ -16,7 +16,6 @@ spec: targetRevision: dev destination: server: 'https://kubernetes.default.svc' - namespace: louper-staging syncPolicy: automated: prune: true diff --git a/.k8s/staging/jobs.yml b/.k8s/staging/jobs.yml index 06ddbb6..0003496 100644 --- a/.k8s/staging/jobs.yml +++ b/.k8s/staging/jobs.yml @@ -1,7 +1,6 @@ apiVersion: batch/v1 kind: Job metadata: - namespace: louper-staging name: github-ci generatedName: build-image-and-push- annotations: diff --git a/.k8s/staging/kustomization.yml b/.k8s/staging/kustomization.yml index c48c808..6bacda3 100644 --- a/.k8s/staging/kustomization.yml +++ b/.k8s/staging/kustomization.yml @@ -15,8 +15,14 @@ patches: kind: Service name: louper-service path: service-patch.yml - -namespace: louper-staging +transformers: + - |- + apiVersion: builtin + kind: NamespaceTransformer + metadata: + name: nsTransform + namespace: louper-staging + unsetOnly: true nameSuffix: -staging commonLabels: app: louper-staging