From 35101c88de1478b110bd560d2389f0b674b97557 Mon Sep 17 00:00:00 2001 From: Tobias Persson Date: Wed, 4 Oct 2023 09:12:41 +0200 Subject: [PATCH] Add kustomization manifest files (#81) --- manifests/base/api/deployment.yaml | 34 ++++++++++++++++++++++ manifests/base/api/service-account.yaml | 8 +++++ manifests/base/api/service.yaml | 17 +++++++++++ manifests/base/kustomization.yaml | 19 ++++++++++++ manifests/base/worker/deployment.yaml | 28 ++++++++++++++++++ manifests/base/worker/service-account.yaml | 8 +++++ 6 files changed, 114 insertions(+) create mode 100644 manifests/base/api/deployment.yaml create mode 100644 manifests/base/api/service-account.yaml create mode 100644 manifests/base/api/service.yaml create mode 100644 manifests/base/kustomization.yaml create mode 100644 manifests/base/worker/deployment.yaml create mode 100644 manifests/base/worker/service-account.yaml diff --git a/manifests/base/api/deployment.yaml b/manifests/base/api/deployment.yaml new file mode 100644 index 0000000..adb8bfd --- /dev/null +++ b/manifests/base/api/deployment.yaml @@ -0,0 +1,34 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: etos-environment-provider + labels: + app.kubernetes.io/name: etos-environment-provider + app.kubernetes.io/part-of: etos + app.kubernetes.io/component: environment-provider-api +spec: + selector: + matchLabels: + app.kubernetes.io/name: etos-environment-provider + template: + metadata: + labels: + app.kubernetes.io/name: etos-environment-provider + spec: + serviceAccountName: etos-environment-provider + containers: + - name: etos-environment-provider + image: "registry.nordix.org/eiffel/etos-environment-provider:2.2.1" + imagePullPolicy: IfNotPresent + ports: + - name: http + containerPort: 8080 + protocol: TCP + livenessProbe: + httpGet: + path: /?id=healthcheck + port: http + readinessProbe: + httpGet: + path: /?id=healthcheck + port: http diff --git a/manifests/base/api/service-account.yaml b/manifests/base/api/service-account.yaml new file mode 100644 index 0000000..86bfd52 --- /dev/null +++ b/manifests/base/api/service-account.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: etos-environment-provider + labels: + app.kubernetes.io/name: etos-environment-provider + app.kubernetes.io/part-of: etos + app.kubernetes.io/component: environment-provider-api diff --git a/manifests/base/api/service.yaml b/manifests/base/api/service.yaml new file mode 100644 index 0000000..8f70019 --- /dev/null +++ b/manifests/base/api/service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: etos-environment-provider + labels: + app.kubernetes.io/name: etos-environment-provider + app.kubernetes.io/part-of: etos + app.kubernetes.io/component: environment-provider-api +spec: + type: ClusterIP + ports: + - port: 80 + targetPort: http + protocol: TCP + name: http + selector: + app.kubernetes.io/name: etos-environment-provider diff --git a/manifests/base/kustomization.yaml b/manifests/base/kustomization.yaml new file mode 100644 index 0000000..dc6dc07 --- /dev/null +++ b/manifests/base/kustomization.yaml @@ -0,0 +1,19 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - api/service-account.yaml + - api/deployment.yaml + - api/service.yaml + - worker/service-account.yaml + - worker/deployment.yaml + + +# By generating the configmap it will get a unique name on each apply +# this name is also set on the deployment. This means that the pods +# will restart with the new configmap when changes are made. Making +# it so we do not have to do rollout restart every time. +configMapGenerator: + - name: etos-environment-provider-worker + literals: + - ETR_VERSION="3.2.0" + - name: etos-environment-provider diff --git a/manifests/base/worker/deployment.yaml b/manifests/base/worker/deployment.yaml new file mode 100644 index 0000000..5f9b32c --- /dev/null +++ b/manifests/base/worker/deployment.yaml @@ -0,0 +1,28 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: etos-environment-provider-worker + labels: + app.kubernetes.io/name: etos-environment-provider-worker + app.kubernetes.io/part-of: etos + app.kubernetes.io/component: environment-provider-worker +spec: + selector: + matchLabels: + app.kubernetes.io/name: etos-environment-provider-worker + template: + metadata: + labels: + app.kubernetes.io/name: etos-environment-provider-worker + spec: + serviceAccountName: etos-environment-provider-worker + containers: + - name: etos-environment-provider-worker + image: "registry.nordix.org/eiffel/etos-environment-provider-worker:2.2.1" + imagePullPolicy: IfNotPresent + envFrom: + - configMapRef: + name: etos-environment-provider-worker + # This grace period ensures that the environment provider will wait + # for the environment checkouts to complete before shutting down. + terminationGracePeriodSeconds: 4250 diff --git a/manifests/base/worker/service-account.yaml b/manifests/base/worker/service-account.yaml new file mode 100644 index 0000000..f291f09 --- /dev/null +++ b/manifests/base/worker/service-account.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: etos-environment-provider-worker + labels: + app.kubernetes.io/name: etos-environment-provider-worker + app.kubernetes.io/part-of: etos + app.kubernetes.io/component: environment-provider-worker