From 2593eb120f796a363112c9a4e96d0fe8516ec4e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Alonso=20L=C3=B3pez?= Date: Tue, 10 Dec 2024 12:04:12 +0100 Subject: [PATCH] Added Kustomize --- .../base/001_terminology-deployment.yaml | 20 +++++++++++++++++++ .../base}/002_terminology-svc.yaml | 7 ++----- .../base}/003_terminology-vs.yaml | 8 ++++---- kubernetes/base/kustomization.yaml | 7 +++++++ .../dev}/001_terminology-deployment.yaml | 10 +++++----- kubernetes/dev/kustomization.yaml | 8 ++++++++ 6 files changed, 46 insertions(+), 14 deletions(-) create mode 100644 kubernetes/base/001_terminology-deployment.yaml rename {YAMLs => kubernetes/base}/002_terminology-svc.yaml (50%) rename {YAMLs => kubernetes/base}/003_terminology-vs.yaml (65%) create mode 100644 kubernetes/base/kustomization.yaml rename {YAMLs => kubernetes/dev}/001_terminology-deployment.yaml (67%) create mode 100644 kubernetes/dev/kustomization.yaml diff --git a/kubernetes/base/001_terminology-deployment.yaml b/kubernetes/base/001_terminology-deployment.yaml new file mode 100644 index 0000000..70488e7 --- /dev/null +++ b/kubernetes/base/001_terminology-deployment.yaml @@ -0,0 +1,20 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: terminology-service +spec: + replicas: 1 + selector: + matchLabels: + app: terminology-service + template: + metadata: + labels: + app: terminology-service + spec: + containers: + - name: terminology-service + image: gravitate-registry.cr.de-fra.ionos.com/terminology-service:v0.3.0 + imagePullPolicy: Always + ports: + - containerPort: 3000 diff --git a/YAMLs/002_terminology-svc.yaml b/kubernetes/base/002_terminology-svc.yaml similarity index 50% rename from YAMLs/002_terminology-svc.yaml rename to kubernetes/base/002_terminology-svc.yaml index d8707e3..1cf74ed 100644 --- a/YAMLs/002_terminology-svc.yaml +++ b/kubernetes/base/002_terminology-svc.yaml @@ -1,13 +1,10 @@ apiVersion: v1 kind: Service metadata: - name: terminology-svc - # annotations: - # prometheus.io/port: '3000' - # prometheus.io/scrape: 'true' + name: terminology-service spec: selector: - app: terminology-svc + app: terminology-service ports: - protocol: TCP port: 3000 diff --git a/YAMLs/003_terminology-vs.yaml b/kubernetes/base/003_terminology-vs.yaml similarity index 65% rename from YAMLs/003_terminology-vs.yaml rename to kubernetes/base/003_terminology-vs.yaml index 0731de9..8277a9a 100644 --- a/YAMLs/003_terminology-vs.yaml +++ b/kubernetes/base/003_terminology-vs.yaml @@ -1,7 +1,7 @@ apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: - name: terminology-svc + name: terminology-service spec: hosts: - "*" @@ -12,9 +12,9 @@ spec: - uri: prefix: /terminologies/ rewrite: - uri: "/" + uri: "/" route: - destination: - host: terminology-svc.default.svc.cluster.local + host: terminology-service.default.svc.cluster.local port: - number: 3000 \ No newline at end of file + number: 3000 diff --git a/kubernetes/base/kustomization.yaml b/kubernetes/base/kustomization.yaml new file mode 100644 index 0000000..45eaa62 --- /dev/null +++ b/kubernetes/base/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - 001_terminology-deployment.yaml + - 002_terminology-svc.yaml + - 003_terminology-vs.yaml \ No newline at end of file diff --git a/YAMLs/001_terminology-deployment.yaml b/kubernetes/dev/001_terminology-deployment.yaml similarity index 67% rename from YAMLs/001_terminology-deployment.yaml rename to kubernetes/dev/001_terminology-deployment.yaml index 294b84b..9f72ee5 100644 --- a/YAMLs/001_terminology-deployment.yaml +++ b/kubernetes/dev/001_terminology-deployment.yaml @@ -6,15 +6,15 @@ spec: replicas: 1 selector: matchLabels: - app: terminology-svc + app: terminology-service template: metadata: labels: - app: terminology-svc + app: terminology-service spec: containers: - - name: terminology-svc - image: gravitate-registry.cr.de-fra.ionos.com/terminology:latest + - name: terminology-service + image: gravitate-registry.cr.de-fra.ionos.com/terminology-service:latest imagePullPolicy: Always ports: - - containerPort: 3000 \ No newline at end of file + - containerPort: 3000 diff --git a/kubernetes/dev/kustomization.yaml b/kubernetes/dev/kustomization.yaml new file mode 100644 index 0000000..4f7dd12 --- /dev/null +++ b/kubernetes/dev/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../base + +patches: + - path: 001_terminology-deployment.yaml \ No newline at end of file