From 1b1d065b08d65c1f79bc0eb0488f8ff63ec159a0 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Thu, 8 Feb 2024 16:52:19 +0100 Subject: [PATCH] Add health --- argocd/overlays/test/kustomization.yaml | 12 +++++----- health/base/health-deployment.yml | 26 ++++++++++++++++++++ health/base/health-ingress.yml | 32 +++++++++++++++++++++++++ health/base/health-namespace.yml | 8 +++++++ health/base/health-service.yml | 25 +++++++++++++++++++ health/base/kustomization.yaml | 7 ++++++ health/overlays/prod/health-ingress.yml | 32 +++++++++++++++++++++++++ health/overlays/prod/kustomization.yaml | 6 +++++ health/overlays/test/health-ingress.yml | 32 +++++++++++++++++++++++++ health/overlays/test/kustomization.yaml | 6 +++++ 10 files changed, 180 insertions(+), 6 deletions(-) create mode 100644 health/base/health-deployment.yml create mode 100644 health/base/health-ingress.yml create mode 100644 health/base/health-namespace.yml create mode 100644 health/base/health-service.yml create mode 100644 health/base/kustomization.yaml create mode 100644 health/overlays/prod/health-ingress.yml create mode 100644 health/overlays/prod/kustomization.yaml create mode 100644 health/overlays/test/health-ingress.yml create mode 100644 health/overlays/test/kustomization.yaml diff --git a/argocd/overlays/test/kustomization.yaml b/argocd/overlays/test/kustomization.yaml index 268ff77..72efb0e 100644 --- a/argocd/overlays/test/kustomization.yaml +++ b/argocd/overlays/test/kustomization.yaml @@ -1,8 +1,8 @@ -apiVersion: 'kustomize.config.k8s.io/v1beta1' +apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -bases: +resources: - ../../base -patchesStrategicMerge: -- argocd-server-deployment.yaml -- argocd-repo-server-deployment.yaml -- argocd-cm.yaml +patches: +- path: argocd-server-deployment.yaml +- path: argocd-repo-server-deployment.yaml +- path: argocd-cm.yaml diff --git a/health/base/health-deployment.yml b/health/base/health-deployment.yml new file mode 100644 index 0000000..fb8adc1 --- /dev/null +++ b/health/base/health-deployment.yml @@ -0,0 +1,26 @@ +--- +kind: Deployment +apiVersion: apps/v1 +metadata: + name: health-node + namespace: health + creationTimestamp: + labels: + app: health-node +spec: + replicas: 3 + selector: + matchLabels: + app: health-node + template: + metadata: + creationTimestamp: + labels: + app: health-node + spec: + containers: + - name: echoserver + image: k8s.gcr.io/echoserver:1.4 + resources: {} + strategy: {} +status: {} diff --git a/health/base/health-ingress.yml b/health/base/health-ingress.yml new file mode 100644 index 0000000..305dd3e --- /dev/null +++ b/health/base/health-ingress.yml @@ -0,0 +1,32 @@ +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: health-ingress + namespace: health + annotations: + kubernetes.io/ingress.class: traefik + traefik.ingress.kubernetes.io/router.entrypoints: websecure + traefik.ingress.kubernetes.io/router.tls: "true" +spec: + defaultBackend: + service: + name: health-node + port: + number: 8443 + tls: + - hosts: + - kube.drive.test.sunet.se + secretName: tls-secret + + rules: + - host: kube.drive.test.sunet.se + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: health-node + port: + number: 8080 diff --git a/health/base/health-namespace.yml b/health/base/health-namespace.yml new file mode 100644 index 0000000..e4cecd0 --- /dev/null +++ b/health/base/health-namespace.yml @@ -0,0 +1,8 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: health +spec: + finalizers: + - kubernetes diff --git a/health/base/health-service.yml b/health/base/health-service.yml new file mode 100644 index 0000000..c8f74ce --- /dev/null +++ b/health/base/health-service.yml @@ -0,0 +1,25 @@ +--- +apiVersion: v1 +items: +- apiVersion: v1 + kind: Service + metadata: + labels: + app: health-node + name: health-node + namespace: health + spec: + ports: + - port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app: health-node + sessionAffinity: None + type: ClusterIP + status: + loadBalancer: {} +kind: List +metadata: + resourceVersion: "" + selfLink: "" diff --git a/health/base/kustomization.yaml b/health/base/kustomization.yaml new file mode 100644 index 0000000..67a6292 --- /dev/null +++ b/health/base/kustomization.yaml @@ -0,0 +1,7 @@ +resources: +- health-deployment.yml +- health-ingress.yml +- health-namespace.yml +- health-service.yml +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization diff --git a/health/overlays/prod/health-ingress.yml b/health/overlays/prod/health-ingress.yml new file mode 100644 index 0000000..441ebdb --- /dev/null +++ b/health/overlays/prod/health-ingress.yml @@ -0,0 +1,32 @@ +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: health-ingress + namespace: health + annotations: + kubernetes.io/ingress.class: traefik + traefik.ingress.kubernetes.io/router.entrypoints: websecure + traefik.ingress.kubernetes.io/router.tls: "true" +spec: + defaultBackend: + service: + name: health-node + port: + number: 8443 + tls: + - hosts: + - kube.drive.sunet.se + secretName: tls-secret + + rules: + - host: kube.drive.sunet.se + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: health-node + port: + number: 8080 diff --git a/health/overlays/prod/kustomization.yaml b/health/overlays/prod/kustomization.yaml new file mode 100644 index 0000000..85cb3f1 --- /dev/null +++ b/health/overlays/prod/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: 'kustomize.config.k8s.io/v1beta1' +kind: Kustomization +bases: +- ../../base +patchesStrategicMerge: +- health-ingress.yml diff --git a/health/overlays/test/health-ingress.yml b/health/overlays/test/health-ingress.yml new file mode 100644 index 0000000..305dd3e --- /dev/null +++ b/health/overlays/test/health-ingress.yml @@ -0,0 +1,32 @@ +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: health-ingress + namespace: health + annotations: + kubernetes.io/ingress.class: traefik + traefik.ingress.kubernetes.io/router.entrypoints: websecure + traefik.ingress.kubernetes.io/router.tls: "true" +spec: + defaultBackend: + service: + name: health-node + port: + number: 8443 + tls: + - hosts: + - kube.drive.test.sunet.se + secretName: tls-secret + + rules: + - host: kube.drive.test.sunet.se + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: health-node + port: + number: 8080 diff --git a/health/overlays/test/kustomization.yaml b/health/overlays/test/kustomization.yaml new file mode 100644 index 0000000..d323ebf --- /dev/null +++ b/health/overlays/test/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ../../base +patches: +- path: health-ingress.yml