about summary refs log tree commit diff
path: root/k8s
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2024-05-25 13:31:29 +0200
committerBaitinq <manuelpalenzuelamerino@gmail.com>2024-05-25 14:06:15 +0200
commit95d0076060f945f9096f00d60c192cdbdcb611ca (patch)
tree3a8f83de5c5ac3c2a6d1dc33d9398a7761964028 /k8s
parentrest-api: deploy with bazel (diff)
downloadfs-tracer-backend-95d0076060f945f9096f00d60c192cdbdcb611ca.tar.gz
fs-tracer-backend-95d0076060f945f9096f00d60c192cdbdcb611ca.tar.bz2
fs-tracer-backend-95d0076060f945f9096f00d60c192cdbdcb611ca.zip
payload-processor: deploy with bazel
Diffstat (limited to 'k8s')
-rw-r--r--k8s/payload-processor/BUILD.bazel14
-rw-r--r--k8s/payload-processor/templates/deployment.yaml5
-rw-r--r--k8s/payload-processor/templates/serviceaccount.yaml12
-rw-r--r--k8s/payload-processor/values.yaml47
-rw-r--r--k8s/rest-api/README.md1
5 files changed, 20 insertions, 59 deletions
diff --git a/k8s/payload-processor/BUILD.bazel b/k8s/payload-processor/BUILD.bazel
new file mode 100644
index 0000000..a2f1fbb
--- /dev/null
+++ b/k8s/payload-processor/BUILD.bazel
@@ -0,0 +1,14 @@
+load("@rules_helm//helm:defs.bzl", "helm_chart")
+
+helm_chart(
+    name = "chart",
+    chart = "Chart.yaml",
+    images = ["//src/payload-processor/cmd:push"],
+    install_name = "payload-processor",
+    stamp = 1,
+    substitutions = {
+        "IMAGE_TAG": "payload-processor-{STABLE_GIT_SHA}",
+        "DB_PASSWORD": "{DB_PASSWORD}"
+    },
+    values = "values.yaml",
+)
diff --git a/k8s/payload-processor/templates/deployment.yaml b/k8s/payload-processor/templates/deployment.yaml
index 6ab4c90..2ffd225 100644
--- a/k8s/payload-processor/templates/deployment.yaml
+++ b/k8s/payload-processor/templates/deployment.yaml
@@ -5,9 +5,7 @@ metadata:
   labels:
     {{- include "payload-processor.labels" . | nindent 4 }}
 spec:
-  {{- if not .Values.autoscaling.enabled }}
   replicas: {{ .Values.replicaCount }}
-  {{- end }}
   selector:
     matchLabels:
       {{- include "payload-processor.selectorLabels" . | nindent 6 }}
@@ -24,12 +22,11 @@ spec:
       imagePullSecrets:
         {{- toYaml . | nindent 8 }}
       {{- end }}
-      serviceAccountName: {{ include "payload-processor.serviceAccountName" . }}
       securityContext:
         {{- toYaml .Values.podSecurityContext | nindent 8 }}
       containers:
         - name: {{ .Chart.Name }}
-          image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
+          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
           imagePullPolicy: {{ .Values.image.pullPolicy }}
           resources:
             {{- toYaml .Values.resources | nindent 12 }}
diff --git a/k8s/payload-processor/templates/serviceaccount.yaml b/k8s/payload-processor/templates/serviceaccount.yaml
deleted file mode 100644
index 55e048e..0000000
--- a/k8s/payload-processor/templates/serviceaccount.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-{{- if .Values.serviceAccount.create -}}
-apiVersion: v1
-kind: ServiceAccount
-metadata:
-  name: {{ include "payload-processor.serviceAccountName" . }}
-  labels:
-    {{- include "payload-processor.labels" . | nindent 4 }}
-  {{- with .Values.serviceAccount.annotations }}
-  annotations:
-    {{- toYaml . | nindent 4 }}
-  {{- end }}
-{{- end }}
diff --git a/k8s/payload-processor/values.yaml b/k8s/payload-processor/values.yaml
index a245901..77355e5 100644
--- a/k8s/payload-processor/values.yaml
+++ b/k8s/payload-processor/values.yaml
@@ -2,53 +2,16 @@
 # This is a YAML-formatted file.
 # Declare variables to be passed into your templates.
 
+# NOTE: This string "@@//src/payload-processor/cmd:push" needs to be present
+# in order to limtations of the helm_rules bazel package
+
 replicaCount: 1
 
 db:
-  password: ""
+  password: "{DB_PASSWORD}"
 
 image:
   repository: docker.io/baitinq/fs-tracer
   pullPolicy: IfNotPresent
   # Overrides the image tag whose default is the chart appVersion.
-  tag: ""
-
-imagePullSecrets: []
-nameOverride: ""
-fullnameOverride: ""
-
-serviceAccount:
-  # Specifies whether a service account should be created
-  create: true
-  # Annotations to add to the service account
-  annotations: {}
-  # The name of the service account to use.
-  # If not set and create is true, a name is generated using the fullname template
-  name: ""
-
-podAnnotations: {}
-
-resources: {}
-  # We usually recommend not to specify default resources and to leave this as a conscious
-  # choice for the user. This also increases chances charts run on environments with little
-  # resources, such as Minikube. If you do want to specify resources, uncomment the following
-  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
-  # limits:
-  #   cpu: 100m
-  #   memory: 128Mi
-  # requests:
-  #   cpu: 100m
-  #   memory: 128Mi
-
-autoscaling:
-  enabled: false
-  minReplicas: 1
-  maxReplicas: 100
-  targetCPUUtilizationPercentage: 80
-  # targetMemoryUtilizationPercentage: 80
-
-nodeSelector: {}
-
-tolerations: []
-
-affinity: {}
+  tag: "{IMAGE_TAG}"
diff --git a/k8s/rest-api/README.md b/k8s/rest-api/README.md
deleted file mode 100644
index 4381b6f..0000000
--- a/k8s/rest-api/README.md
+++ /dev/null
@@ -1 +0,0 @@
-helm upgrade rest-api --set image.tag=$(git rev-parse --short HEAD) .