From a71cda6a8f78fc39f80c03aeb4d4f2bc30f2f946 Mon Sep 17 00:00:00 2001 From: Mans Ziesel Date: Fri, 17 Jan 2025 14:39:13 +0100 Subject: [PATCH] add nginx service --- .../base/nginx-testing-application.yaml | 20 ++++++++++++++ argocd-applications/kustomization.yaml | 1 + .../base/nginx-testing-deployment.yaml | 21 +++++++++++++++ nginx-testing/base/nginx-testing-ingress.yaml | 27 +++++++++++++++++++ .../base/nginx-testing-namespace.yaml | 4 +++ nginx-testing/base/nginx-testing-svc.yaml | 11 ++++++++ nginx-testing/kustomization.yaml | 10 +++++++ 7 files changed, 94 insertions(+) create mode 100644 argocd-applications/base/nginx-testing-application.yaml create mode 100644 nginx-testing/base/nginx-testing-deployment.yaml create mode 100644 nginx-testing/base/nginx-testing-ingress.yaml create mode 100644 nginx-testing/base/nginx-testing-namespace.yaml create mode 100644 nginx-testing/base/nginx-testing-svc.yaml create mode 100644 nginx-testing/kustomization.yaml diff --git a/argocd-applications/base/nginx-testing-application.yaml b/argocd-applications/base/nginx-testing-application.yaml new file mode 100644 index 0000000..6558fc2 --- /dev/null +++ b/argocd-applications/base/nginx-testing-application.yaml @@ -0,0 +1,20 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: argo-app-nginx-testing + namespace: argocd +spec: + destination: + name: '' + namespace: default + server: https://kubernetes.default.svc + source: + path: nginx-testing + repoURL: https://git.mziesel.nl/mans/argocd-test + targetRevision: HEAD + sources: [] + project: default + syncPolicy: + automated: + prune: true + selfHeal: true diff --git a/argocd-applications/kustomization.yaml b/argocd-applications/kustomization.yaml index ca20730..b7d5032 100644 --- a/argocd-applications/kustomization.yaml +++ b/argocd-applications/kustomization.yaml @@ -19,4 +19,5 @@ resources: - ./base/mediaserver-application.yaml - ./base/uptime-kuma-application.yaml - ./base/metrics-server-application.yaml + - ./base/nginx-testing-application.yaml # - ./base/authentik-application.yaml diff --git a/nginx-testing/base/nginx-testing-deployment.yaml b/nginx-testing/base/nginx-testing-deployment.yaml new file mode 100644 index 0000000..b64cd33 --- /dev/null +++ b/nginx-testing/base/nginx-testing-deployment.yaml @@ -0,0 +1,21 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx-testing + namespace: nginx-testing +spec: + replicas: 3 + selector: + matchLabels: + app: nginx-testing + template: + metadata: + labels: + app: nginx-testing + spec: + containers: + - image: nginx:1.27.3 + name: nginx-testing + ports: + - name: web + containerPort: 80 diff --git a/nginx-testing/base/nginx-testing-ingress.yaml b/nginx-testing/base/nginx-testing-ingress.yaml new file mode 100644 index 0000000..3a1cc4a --- /dev/null +++ b/nginx-testing/base/nginx-testing-ingress.yaml @@ -0,0 +1,27 @@ +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: m4n5.online-cert + spec: + secretName: m4n5.online-secret + issuerRef: + name: cloudflare-issuer + kind: ClusterIssuer + dnsNames: + - m4n5.online + - www.m4n5.online +--- +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: nginx-testing-ingressroute +spec: + routes: + - match: Host(`m4n5.online`) || Host(`www.m4n5.online`) + kind: Rule + services: + - name: nginx-testing + port: web + tls: + secretName: m4n5.online-secret diff --git a/nginx-testing/base/nginx-testing-namespace.yaml b/nginx-testing/base/nginx-testing-namespace.yaml new file mode 100644 index 0000000..73dbbb0 --- /dev/null +++ b/nginx-testing/base/nginx-testing-namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: nginx-testing diff --git a/nginx-testing/base/nginx-testing-svc.yaml b/nginx-testing/base/nginx-testing-svc.yaml new file mode 100644 index 0000000..13dc719 --- /dev/null +++ b/nginx-testing/base/nginx-testing-svc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: nginx-testing +spec: + ports: + - name: web + port: 80 + targetPort: web + selector: + app: nginx-testing diff --git a/nginx-testing/kustomization.yaml b/nginx-testing/kustomization.yaml new file mode 100644 index 0000000..97e709f --- /dev/null +++ b/nginx-testing/kustomization.yaml @@ -0,0 +1,10 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: nginx-testing + +resources: + - ./base/nginx-testing-namespace.yaml + - ./base/nginx-testing-deployment.yaml + - ./base/nginx-testing-svc.yaml + - ./base/nginx-testing-ingress.yaml