From 54083e4233aebfbbadc16ef5298c24364af15fc8 Mon Sep 17 00:00:00 2001 From: Alexis Bruneteau Date: Sat, 31 May 2025 17:15:36 +0200 Subject: [PATCH] tag --- .gitea/workflows/deploy.yml | 4 +-- deploy/k3s/frontend/deployment.yml | 23 +++++++++++++ .../ingress.yaml => k3s/frontend/ingress.yml} | 0 deploy/k3s/frontend/kustomization.yml | 5 +++ .../service.yaml => k3s/frontend/service.yml} | 0 deploy/k3s/kustomization.yml | 8 +++++ .../{k8s/namespace.yaml => k3s/namespace.yml} | 0 deploy/k8s/deployment.yaml | 32 ------------------- 8 files changed, 37 insertions(+), 35 deletions(-) create mode 100644 deploy/k3s/frontend/deployment.yml rename deploy/{k8s/ingress.yaml => k3s/frontend/ingress.yml} (100%) create mode 100644 deploy/k3s/frontend/kustomization.yml rename deploy/{k8s/service.yaml => k3s/frontend/service.yml} (100%) create mode 100644 deploy/k3s/kustomization.yml rename deploy/{k8s/namespace.yaml => k3s/namespace.yml} (100%) delete mode 100644 deploy/k8s/deployment.yaml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index f95cf37..d17f10a 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -64,6 +64,4 @@ jobs: - name: Deploy to k3s run: | - kubectl apply -f deploy/k8s/ - kubectl set image deployment/hosting-frontend hosting-frontend=${{ secrets.REGISTRY_URL }}/hosting-frontend:${{ github.sha }} -n hosting-frontend - kubectl rollout status deployment/hosting-frontend -n hosting + kubectl apply -k deploy/k8s/ diff --git a/deploy/k3s/frontend/deployment.yml b/deploy/k3s/frontend/deployment.yml new file mode 100644 index 0000000..d0d8834 --- /dev/null +++ b/deploy/k3s/frontend/deployment.yml @@ -0,0 +1,23 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hosting-frontend + namespace: hosting +spec: + replicas: 2 + selector: + matchLabels: + app: hosting-frontend + template: + metadata: + labels: + app: hosting-frontend + spec: + containers: + - name: hosting-frontend + image: gitea.vidoks.fr/sortifal/hosting-frontend:latest + ports: + - containerPort: 80 + + + diff --git a/deploy/k8s/ingress.yaml b/deploy/k3s/frontend/ingress.yml similarity index 100% rename from deploy/k8s/ingress.yaml rename to deploy/k3s/frontend/ingress.yml diff --git a/deploy/k3s/frontend/kustomization.yml b/deploy/k3s/frontend/kustomization.yml new file mode 100644 index 0000000..68a16cd --- /dev/null +++ b/deploy/k3s/frontend/kustomization.yml @@ -0,0 +1,5 @@ +namespace: hosting +resources: + - deployment.yml + - service.yml + - ingress.yml diff --git a/deploy/k8s/service.yaml b/deploy/k3s/frontend/service.yml similarity index 100% rename from deploy/k8s/service.yaml rename to deploy/k3s/frontend/service.yml diff --git a/deploy/k3s/kustomization.yml b/deploy/k3s/kustomization.yml new file mode 100644 index 0000000..5cff463 --- /dev/null +++ b/deploy/k3s/kustomization.yml @@ -0,0 +1,8 @@ +--- + +kind: Kustomization +namespace: hosting + +resources: + - namespace.yml + - frontend diff --git a/deploy/k8s/namespace.yaml b/deploy/k3s/namespace.yml similarity index 100% rename from deploy/k8s/namespace.yaml rename to deploy/k3s/namespace.yml diff --git a/deploy/k8s/deployment.yaml b/deploy/k8s/deployment.yaml deleted file mode 100644 index f7ceac1..0000000 --- a/deploy/k8s/deployment.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: hosting-frontend - namespace: hosting -spec: - replicas: 2 - selector: - matchLabels: - app: hosting-frontend - template: - metadata: - labels: - app: hosting-frontend - spec: - containers: - - name: hosting-frontend - image: nginx:alpine - ports: - - containerPort: 80 - volumeMounts: - - name: app-volume - mountPath: /usr/share/nginx/html - - name: nginx-config - mountPath: /etc/nginx/conf.d - volumes: - - name: app-volume - configMap: - name: hosting-files - - name: nginx-config - configMap: - name: nginx-config