From 13c9d12db0090959b63395cdd3cd97407b3b2226 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Mon, 10 Oct 2022 17:09:38 +0200 Subject: [PATCH] Added argo deployment --- .argo/application.yaml | 33 +++++++++++++++++++++++ .argo/cert.yaml | 14 ++++++++++ .argo/deployment.yaml | 58 ++++++++++++++++++++++++++++++++++++++++ .argo/dns.yaml | 12 +++++++++ .argo/ingress.yaml | 17 ++++++++++++ .argo/kustomization.yaml | 8 ++++++ .argo/secret.yaml | 9 +++++++ .argo/service.yaml | 15 +++++++++++ 8 files changed, 166 insertions(+) create mode 100644 .argo/application.yaml create mode 100644 .argo/cert.yaml create mode 100644 .argo/deployment.yaml create mode 100644 .argo/dns.yaml create mode 100644 .argo/ingress.yaml create mode 100644 .argo/kustomization.yaml create mode 100644 .argo/secret.yaml create mode 100644 .argo/service.yaml diff --git a/.argo/application.yaml b/.argo/application.yaml new file mode 100644 index 0000000..1af6c96 --- /dev/null +++ b/.argo/application.yaml @@ -0,0 +1,33 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + annotations: + argocd-image-updater.argoproj.io/image-list: docs=registry.odit.services/lfk/docs:latest + argocd-image-updater.argoproj.io/write-back-method: argocd + argocd-image-updater.argoproj.io/update-strategy: digest + argocd-image-updater.argoproj.io/docs.pull-secret: pullsecret:argocd/registry-odit-services + name: docs-lfk-de + namespace: argocd +spec: + project: default + source: + repoURL: "git@git.odit.services:lfk/docs.git" + path: .argo + targetRevision: main + destination: + name: odit + namespace: lfk + syncPolicy: + automated: + prune: true + selfHeal: true + allowEmpty: false + syncOptions: + - PruneLast=true + - CreateNamespace=true + retry: + limit: 5 + backoff: + duration: 20s + factor: 2 + maxDuration: 7m \ No newline at end of file diff --git a/.argo/cert.yaml b/.argo/cert.yaml new file mode 100644 index 0000000..0963c65 --- /dev/null +++ b/.argo/cert.yaml @@ -0,0 +1,14 @@ +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: docs-lfk-de-cert + namespace: lfk +spec: + commonName: docs.lauf-fuer-kaya.de + secretName: docs-lfk-de-cert + dnsNames: + - docs.lauf-fuer-kaya.de + issuerRef: + name: letsencrypt-prod + kind: ClusterIssuer \ No newline at end of file diff --git a/.argo/deployment.yaml b/.argo/deployment.yaml new file mode 100644 index 0000000..15d86d4 --- /dev/null +++ b/.argo/deployment.yaml @@ -0,0 +1,58 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: docs-lfk-de + namespace: lfk + labels: + app: docs-lfk-de +spec: + replicas: 1 + revisionHistoryLimit: 10 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + selector: + matchLabels: + app: docs-lfk-de + template: + metadata: + labels: + app: docs-lfk-de + spec: + containers: + - name: docs-lfk-de + image: registry.odit.services/lfk/docs:latest + imagePullPolicy: IfNotPresent + ports: + - containerPort: 80 + name: web + resources: + requests: + cpu: 50m + memory: 10Mi + limits: + cpu: 100m + memory: 128Mi + readinessProbe: + httpGet: + path: /health/ + port: 80 + initialDelaySeconds: 5 + periodSeconds: 3 + successThreshold: 4 + livenessProbe: + httpGet: + path: /health/ + port: 80 + initialDelaySeconds: 5 + periodSeconds: 3 + lifecycle: + preStop: + exec: + command: ["/bin/sh", "-c", "sleep 10"] + imagePullSecrets: + - name: registry-odit-services + restartPolicy: Always diff --git a/.argo/dns.yaml b/.argo/dns.yaml new file mode 100644 index 0000000..49a8eb6 --- /dev/null +++ b/.argo/dns.yaml @@ -0,0 +1,12 @@ +apiVersion: externaldns.k8s.io/v1alpha1 +kind: DNSEndpoint +metadata: + name: docs-lfk-de-dns + namespace: lfk +spec: + endpoints: + - dnsName: docs.lauf-fuer-kaya.de + recordTTL: 180 + recordType: CNAME + targets: + - k.odit.services \ No newline at end of file diff --git a/.argo/ingress.yaml b/.argo/ingress.yaml new file mode 100644 index 0000000..ae0fba2 --- /dev/null +++ b/.argo/ingress.yaml @@ -0,0 +1,17 @@ +--- +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: docs-lfk-de + namespace: lfk +spec: + entryPoints: + - websecure + routes: + - match: Host(`docs.lauf-fuer-kaya.de`) + kind: Rule + services: + - name: docs-lfk-de + port: 80 + tls: + secretName: docs-lfk-de-cert \ No newline at end of file diff --git a/.argo/kustomization.yaml b/.argo/kustomization.yaml new file mode 100644 index 0000000..471f488 --- /dev/null +++ b/.argo/kustomization.yaml @@ -0,0 +1,8 @@ +namespace: lfk +resources: +- deployment.yaml +- service.yaml +- ingress.yaml +- secret.yaml +- cert.yaml +- dns.yaml \ No newline at end of file diff --git a/.argo/secret.yaml b/.argo/secret.yaml new file mode 100644 index 0000000..4d9536d --- /dev/null +++ b/.argo/secret.yaml @@ -0,0 +1,9 @@ +type: kubernetes.io/dockerconfigjson +apiVersion: v1 +kind: Secret +metadata: + name: registry-odit-services + namespace: lfk +data: + .dockerconfigjson: >- + eyJhdXRocyI6eyJyZWdpc3RyeS5vZGl0LnNlcnZpY2VzIjp7InVzZXJuYW1lIjoicm9ib3Qkb2RpdF9wdWxsZXIiLCJwYXNzd29yZCI6ImdVYmowaElTRklKUnZuTFlLNzNxQkFBS3VvYUZpM3pzIiwiZW1haWwiOiJib3RAb2RpdC5zZXJ2aWNlcyIsImF1dGgiOiJjbTlpYjNRa2IyUnBkRjl3ZFd4c1pYSTZaMVZpYWpCb1NWTkdTVXBTZG01TVdVczNNM0ZDUVVGTGRXOWhSbWt6ZW5NPSJ9fX0= diff --git a/.argo/service.yaml b/.argo/service.yaml new file mode 100644 index 0000000..bfd97fd --- /dev/null +++ b/.argo/service.yaml @@ -0,0 +1,15 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: docs-lfk-de + namespace: lfk + labels: + app: docs-lfk-de +spec: + ports: + - port: 80 + name: web + selector: + app: docs-lfk-de + type: ClusterIP \ No newline at end of file