From a8ef89bf026129b9ca22459a19d480b05b66339b Mon Sep 17 00:00:00 2001 From: Apoorva Srinivas Appadoo Date: Sun, 13 Oct 2024 14:48:42 +0200 Subject: [PATCH] feat: add manifests for services --- README.md | 4 +-- .../manifests/base/deployment.yml | 30 +++++++++++++++++++ .../manifests/base/ingress.yml | 24 +++++++++++++++ .../manifests/base/kustomization.yml | 7 +++++ .../manifests/base/service.yml | 13 ++++++++ .../manifests/base/deployment.yml | 30 +++++++++++++++++++ .../manifests/base/ingress.yml | 24 +++++++++++++++ .../manifests/base/kustomization.yml | 7 +++++ .../manifests/base/service.yml | 13 ++++++++ kind/apps/al/kustomization.yml | 2 ++ kind/kustomization.yml | 2 +- ...tory.yaml => bitnami-helm-repository.yaml} | 0 manifests/base/keycloak/kustomization.yaml | 1 - manifests/base/kustomization.yaml | 6 +++- manifests/base/mongodb/helm-release.yaml | 15 ++++++++++ manifests/base/mongodb/kustomization.yaml | 2 ++ 16 files changed, 175 insertions(+), 5 deletions(-) create mode 100644 cloud/backend/alert-management/manifests/base/deployment.yml create mode 100644 cloud/backend/alert-management/manifests/base/ingress.yml create mode 100644 cloud/backend/alert-management/manifests/base/kustomization.yml create mode 100644 cloud/backend/alert-management/manifests/base/service.yml create mode 100644 cloud/backend/patient-management/manifests/base/deployment.yml create mode 100644 cloud/backend/patient-management/manifests/base/ingress.yml create mode 100644 cloud/backend/patient-management/manifests/base/kustomization.yml create mode 100644 cloud/backend/patient-management/manifests/base/service.yml create mode 100644 kind/apps/al/kustomization.yml rename manifests/base/{keycloak/helm-repository.yaml => bitnami-helm-repository.yaml} (100%) create mode 100644 manifests/base/mongodb/helm-release.yaml create mode 100644 manifests/base/mongodb/kustomization.yaml diff --git a/README.md b/README.md index 911b67c..698b2c9 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ### Create Kind cluster ```bash -kind create cluster --config kind-config.yaml +kind create cluster --config kind-cluster.yaml ``` ### Install Manifests @@ -14,5 +14,5 @@ NB: The command will fail on the first run because the crds are not yet created. ### Add the following entries to /etc/hosts ```bash -127.0.0.1 keycloak.al.apoorva64.com prometheus.al.apoorva64.com grafana.al.apoorva64.com +127.0.0.1 keycloak.al.apoorva64.com prometheus.al.apoorva64.com grafana.al.apoorva64.com patient-management.al.apoorva64.com alert-management.al.apoorva64.com ``` \ No newline at end of file diff --git a/cloud/backend/alert-management/manifests/base/deployment.yml b/cloud/backend/alert-management/manifests/base/deployment.yml new file mode 100644 index 0000000..f916b36 --- /dev/null +++ b/cloud/backend/alert-management/manifests/base/deployment.yml @@ -0,0 +1,30 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + io.kompose.service: alert-management + name: alert-management +spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: alert-management + template: + metadata: + labels: + io.kompose.service: alert-management + spec: + containers: + - image: ghcr.io/startupnationlabs/poulet/alert-management:e3911b5eaa38b49c29022ad6c7e83d45884a7f32 + name: alert-management + ports: + - containerPort: 8080 + protocol: TCP + resources: + requests: + cpu: "100m" + memory: "128Mi" + limits: + cpu: "500m" + memory: "512Mi" + restartPolicy: Always diff --git a/cloud/backend/alert-management/manifests/base/ingress.yml b/cloud/backend/alert-management/manifests/base/ingress.yml new file mode 100644 index 0000000..93f5065 --- /dev/null +++ b/cloud/backend/alert-management/manifests/base/ingress.yml @@ -0,0 +1,24 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: ingress-alert-management + annotations: + kubernetes.io/ingress.class: traefik + cert-manager.io/cluster-issuer: letsencrypt-prod + traefik.ingress.kubernetes.io/router.middlewares: default-redirect-https@kubernetescrd +spec: + rules: + - host: alert-management.al.polytech.apoorva64.com + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: alert-management + port: + number: 8080 + tls: + - hosts: + - alert-management.al.polytech.apoorva64.com + secretName: alert-management.al.polytech.apoorva64-tls diff --git a/cloud/backend/alert-management/manifests/base/kustomization.yml b/cloud/backend/alert-management/manifests/base/kustomization.yml new file mode 100644 index 0000000..5343fb8 --- /dev/null +++ b/cloud/backend/alert-management/manifests/base/kustomization.yml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 + +kind: Kustomization +resources: + - deployment.yml + - ingress.yml + - service.yml \ No newline at end of file diff --git a/cloud/backend/alert-management/manifests/base/service.yml b/cloud/backend/alert-management/manifests/base/service.yml new file mode 100644 index 0000000..f1134dc --- /dev/null +++ b/cloud/backend/alert-management/manifests/base/service.yml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + io.kompose.service: alert-management + name: alert-management +spec: + ports: + - name: "8080" + port: 8080 + targetPort: 8080 + selector: + io.kompose.service: alert-management diff --git a/cloud/backend/patient-management/manifests/base/deployment.yml b/cloud/backend/patient-management/manifests/base/deployment.yml new file mode 100644 index 0000000..56c7c38 --- /dev/null +++ b/cloud/backend/patient-management/manifests/base/deployment.yml @@ -0,0 +1,30 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + io.kompose.service: patient-management + name: patient-management +spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: patient-management + template: + metadata: + labels: + io.kompose.service: patient-management + spec: + containers: + - image: ghcr.io/startupnationlabs/poulet/patient-management:e3911b5eaa38b49c29022ad6c7e83d45884a7f32 + name: patient-management + ports: + - containerPort: 8080 + protocol: TCP + resources: + requests: + cpu: "100m" + memory: "128Mi" + limits: + cpu: "500m" + memory: "512Mi" + restartPolicy: Always diff --git a/cloud/backend/patient-management/manifests/base/ingress.yml b/cloud/backend/patient-management/manifests/base/ingress.yml new file mode 100644 index 0000000..e4ecc0c --- /dev/null +++ b/cloud/backend/patient-management/manifests/base/ingress.yml @@ -0,0 +1,24 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: ingress-patient-management + annotations: + kubernetes.io/ingress.class: traefik + cert-manager.io/cluster-issuer: letsencrypt-prod + traefik.ingress.kubernetes.io/router.middlewares: default-redirect-https@kubernetescrd +spec: + rules: + - host: patient-management.al.polytech.apoorva64.com + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: patient-management + port: + number: 8080 + tls: + - hosts: + - patient-management.al.polytech.apoorva64.com + secretName: patient-management.al.polytech.apoorva64-tls diff --git a/cloud/backend/patient-management/manifests/base/kustomization.yml b/cloud/backend/patient-management/manifests/base/kustomization.yml new file mode 100644 index 0000000..5343fb8 --- /dev/null +++ b/cloud/backend/patient-management/manifests/base/kustomization.yml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 + +kind: Kustomization +resources: + - deployment.yml + - ingress.yml + - service.yml \ No newline at end of file diff --git a/cloud/backend/patient-management/manifests/base/service.yml b/cloud/backend/patient-management/manifests/base/service.yml new file mode 100644 index 0000000..9dadcb6 --- /dev/null +++ b/cloud/backend/patient-management/manifests/base/service.yml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + io.kompose.service: patient-management + name: patient-management +spec: + ports: + - name: "8080" + port: 8080 + targetPort: 8080 + selector: + io.kompose.service: patient-management diff --git a/kind/apps/al/kustomization.yml b/kind/apps/al/kustomization.yml new file mode 100644 index 0000000..01a49e3 --- /dev/null +++ b/kind/apps/al/kustomization.yml @@ -0,0 +1,2 @@ +resources: + - ../../../manifests/base \ No newline at end of file diff --git a/kind/kustomization.yml b/kind/kustomization.yml index 978dd9f..7c7bd03 100644 --- a/kind/kustomization.yml +++ b/kind/kustomization.yml @@ -4,4 +4,4 @@ kind: Kustomization resources: - infrastructure/flux-cd - infrastructure/traefik - - ../manifests/base \ No newline at end of file + - apps/al diff --git a/manifests/base/keycloak/helm-repository.yaml b/manifests/base/bitnami-helm-repository.yaml similarity index 100% rename from manifests/base/keycloak/helm-repository.yaml rename to manifests/base/bitnami-helm-repository.yaml diff --git a/manifests/base/keycloak/kustomization.yaml b/manifests/base/keycloak/kustomization.yaml index 0e7d2e9..8570ebe 100644 --- a/manifests/base/keycloak/kustomization.yaml +++ b/manifests/base/keycloak/kustomization.yaml @@ -1,6 +1,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - helm-repository.yaml - helm-release.yaml - ingress.yaml \ No newline at end of file diff --git a/manifests/base/kustomization.yaml b/manifests/base/kustomization.yaml index b8bdff9..8d12ebc 100644 --- a/manifests/base/kustomization.yaml +++ b/manifests/base/kustomization.yaml @@ -1,4 +1,8 @@ resources: + - bitnami-helm-repository.yaml + - mongodb - prometheus - grafana - - keycloak \ No newline at end of file + - keycloak + - ../../cloud/backend/alert-management/manifests/base + - ../../cloud/backend/patient-management/manifests/base \ No newline at end of file diff --git a/manifests/base/mongodb/helm-release.yaml b/manifests/base/mongodb/helm-release.yaml new file mode 100644 index 0000000..080335f --- /dev/null +++ b/manifests/base/mongodb/helm-release.yaml @@ -0,0 +1,15 @@ +apiVersion: helm.toolkit.fluxcd.io/v2beta1 +kind: HelmRelease +metadata: + name: mongodb +spec: + interval: 60m + chart: + spec: + chart: mongodb + version: "16.0.3" + sourceRef: + kind: HelmRepository + name: bitnami + interval: 12h + values: {} diff --git a/manifests/base/mongodb/kustomization.yaml b/manifests/base/mongodb/kustomization.yaml new file mode 100644 index 0000000..10ade13 --- /dev/null +++ b/manifests/base/mongodb/kustomization.yaml @@ -0,0 +1,2 @@ +resources: + - helm-release.yaml \ No newline at end of file