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