diff --git a/.github/workflows/collaboration_service.yml b/.github/workflows/collaboration_service.yml index 084cd084..4868df53 100644 --- a/.github/workflows/collaboration_service.yml +++ b/.github/workflows/collaboration_service.yml @@ -7,7 +7,7 @@ on: - 'backend/services/collaboration/**' jobs: - build-collaboration: + build-carddeck: uses: ./.github/workflows/build_service.yml with: image-name: kioku_collaboration diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 065d90ea..97716641 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,17 +15,17 @@ jobs: build-register: uses: ./.github/workflows/build_service.yml with: - image-name: kioku_register + image-name: kioku_carddeck image-tag: prod - path: ./backend/services/register + path: ./backend/services/carddeck context: ./backend build-login: uses: ./.github/workflows/build_service.yml with: - image-name: kioku_login + image-name: kioku_user image-tag: prod - path: ./backend/services/login + path: ./backend/services/user context: ./backend build-frontend-proxy: @@ -34,4 +34,12 @@ jobs: image-name: kioku_frontend_proxy image-tag: prod path: ./backend/services/frontend + context: ./backend + + build-collaboration: + uses: ./.github/workflows/build_service.yml + with: + image-name: kioku_collaboration + image-tag: prod + path: ./backend/services/collaboration context: ./backend \ No newline at end of file diff --git a/helm/kioku/templates/_helpers.tpl b/helm/kioku/templates/_helpers.tpl index 7d15312b..b1c05a79 100644 --- a/helm/kioku/templates/_helpers.tpl +++ b/helm/kioku/templates/_helpers.tpl @@ -63,16 +63,16 @@ app.kubernetes.io/name: {{ .Values.frontend.name }} {{/* Login labels */}} -{{- define "kioku.login.labels" -}} -app.kubernetes.io/name: {{ .Values.login.name }} +{{- define "kioku.carddeck.labels" -}} +app.kubernetes.io/name: {{ .Values.carddeck.name }} {{- end }} {{/* Register labels */}} -{{- define "kioku.register.labels" -}} -app.kubernetes.io/name: {{ .Values.register.name }} -app: {{ .Values.register.name }} +{{- define "kioku.user.labels" -}} +app.kubernetes.io/name: {{ .Values.user.name }} +app: {{ .Values.user.name }} {{- end }} {{/* @@ -82,6 +82,13 @@ Frontend Proxy labels app.kubernetes.io/name: {{ .Values.frontend_proxy.name }} {{- end }} +{{/* +Collaboration labels +*/}} +{{- define "kioku.collaboration.labels" -}} +app.kubernetes.io/name: {{ .Values.collaboration.name }} +{{- end }} + {{/* Selector labels diff --git a/helm/kioku/templates/register.yaml b/helm/kioku/templates/carddeck.yaml similarity index 62% rename from helm/kioku/templates/register.yaml rename to helm/kioku/templates/carddeck.yaml index 23900453..dab55972 100644 --- a/helm/kioku/templates/register.yaml +++ b/helm/kioku/templates/carddeck.yaml @@ -2,23 +2,23 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: "{{ .Values.register.name }}-deployment" + name: "{{ .Values.carddeck.name }}-deployment" labels: - {{- include "kioku.register.labels" . | nindent 4 }} + {{- include "kioku.carddeck.labels" . | nindent 4 }} spec: replicas: 1 selector: matchLabels: - {{- include "kioku.register.labels" . | nindent 6 }} + {{- include "kioku.carddeck.labels" . | nindent 6 }} template: metadata: labels: - {{- include "kioku.register.labels" . | nindent 8 }} + {{- include "kioku.carddeck.labels" . | nindent 8 }} spec: serviceAccountName: go-micro containers: - - name: {{ .Values.register.name }} - image: "{{ .Values.register.image }}:{{ .Values.register.tag }}" + - name: {{ .Values.carddeck.name }} + image: "{{ .Values.carddeck.image }}:{{ .Values.carddeck.tag }}" {{ if eq .Values.mode "production" }} imagePullPolicy: Always {{ else }} @@ -40,6 +40,7 @@ spec: fieldPath: metadata.name - name: PORT value: "8080" + envFrom: - secretRef: name: {{ .Values.database.secret.name }} @@ -49,10 +50,10 @@ spec: apiVersion: v1 kind: Service metadata: - name: "{{ .Values.register.name }}-service" + name: "{{ .Values.carddeck.name }}-service" spec: selector: - {{- include "kioku.register.labels" . | nindent 4 }} + {{- include "kioku.carddeck.labels" . | nindent 4 }} ports: - port: 8080 targetPort: 8080 @@ -60,12 +61,12 @@ spec: apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler metadata: - name: "hpa-{{ .Values.register.name }}-deployment" + name: "hpa-{{ .Values.carddeck.name }}-deployment" spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: "{{ .Values.register.name }}-deployment" - minReplicas: {{ .Values.register.autoscaler.min }} - maxReplicas: {{ .Values.register.autoscaler.max }} - targetCPUUtilizationPercentage: {{ .Values.register.autoscaler.targetCPUUtilizationPercentage }} \ No newline at end of file + name: "{{ .Values.carddeck.name }}-deployment" + minReplicas: {{ .Values.carddeck.autoscaler.min }} + maxReplicas: {{ .Values.carddeck.autoscaler.max }} + targetCPUUtilizationPercentage: {{ .Values.carddeck.autoscaler.targetCPUUtilizationPercentage }} \ No newline at end of file diff --git a/helm/kioku/templates/collaboration.yaml b/helm/kioku/templates/collaboration.yaml new file mode 100644 index 00000000..9ac46faa --- /dev/null +++ b/helm/kioku/templates/collaboration.yaml @@ -0,0 +1,71 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ .Values.collaboration.name }}-deployment" + labels: + {{- include "kioku.collaboration.labels" . | nindent 4 }} +spec: + replicas: 1 + selector: + matchLabels: + {{- include "kioku.collaboration.labels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "kioku.collaboration.labels" . | nindent 8 }} + spec: + serviceAccountName: go-micro + containers: + - name: {{ .Values.collaboration.name }} + image: "{{ .Values.collaboration.image }}:{{ .Values.collaboration.tag }}" + {{ if eq .Values.mode "production" }} + imagePullPolicy: Always + {{ else }} + imagePullPolicy: Never + {{ end }} + ports: + - containerPort: 8080 + resources: + limits: + cpu: 500m + memory: 500M + requests: + cpu: 200m + memory: 200M + env: + - name: HOSTNAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: PORT + value: "8080" + envFrom: + - secretRef: + name: {{ .Values.database.secret.name }} + - configMapRef: + name: service-env +--- +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.collaboration.name }}-service" +spec: + selector: + {{- include "kioku.collaboration.labels" . | nindent 4 }} + ports: + - port: 8080 + targetPort: 8080 +--- +apiVersion: autoscaling/v1 +kind: HorizontalPodAutoscaler +metadata: + name: "hpa-{{ .Values.collaboration.name }}-deployment" +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: "{{ .Values.collaboration.name }}-deployment" + minReplicas: {{ .Values.collaboration.autoscaler.min }} + maxReplicas: {{ .Values.collaboration.autoscaler.max }} + targetCPUUtilizationPercentage: {{ .Values.collaboration.autoscaler.targetCPUUtilizationPercentage }} \ No newline at end of file diff --git a/helm/kioku/templates/login.yaml b/helm/kioku/templates/user.yaml similarity index 61% rename from helm/kioku/templates/login.yaml rename to helm/kioku/templates/user.yaml index 2e75954e..50bb995d 100644 --- a/helm/kioku/templates/login.yaml +++ b/helm/kioku/templates/user.yaml @@ -2,23 +2,23 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: "{{ .Values.login.name }}-deployment" + name: "{{ .Values.user.name }}-deployment" labels: - {{- include "kioku.login.labels" . | nindent 4 }} + {{- include "kioku.user.labels" . | nindent 4 }} spec: replicas: 1 selector: matchLabels: - {{- include "kioku.login.labels" . | nindent 6 }} + {{- include "kioku.user.labels" . | nindent 6 }} template: metadata: labels: - {{- include "kioku.login.labels" . | nindent 8 }} + {{- include "kioku.user.labels" . | nindent 8 }} spec: serviceAccountName: go-micro containers: - - name: {{ .Values.login.name }} - image: "{{ .Values.login.image }}:{{ .Values.login.tag }}" + - name: {{ .Values.user.name }} + image: "{{ .Values.user.image }}:{{ .Values.user.tag }}" {{ if eq .Values.mode "production" }} imagePullPolicy: Always {{ else }} @@ -40,7 +40,6 @@ spec: fieldPath: metadata.name - name: PORT value: "8080" - envFrom: - secretRef: name: {{ .Values.database.secret.name }} @@ -50,10 +49,10 @@ spec: apiVersion: v1 kind: Service metadata: - name: "{{ .Values.login.name }}-service" + name: "{{ .Values.user.name }}-service" spec: selector: - {{- include "kioku.login.labels" . | nindent 4 }} + {{- include "kioku.user.labels" . | nindent 4 }} ports: - port: 8080 targetPort: 8080 @@ -61,12 +60,12 @@ spec: apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler metadata: - name: "hpa-{{ .Values.login.name }}-deployment" + name: "hpa-{{ .Values.user.name }}-deployment" spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: "{{ .Values.login.name }}-deployment" - minReplicas: {{ .Values.login.autoscaler.min }} - maxReplicas: {{ .Values.login.autoscaler.max }} - targetCPUUtilizationPercentage: {{ .Values.login.autoscaler.targetCPUUtilizationPercentage }} \ No newline at end of file + name: "{{ .Values.user.name }}-deployment" + minReplicas: {{ .Values.user.autoscaler.min }} + maxReplicas: {{ .Values.user.autoscaler.max }} + targetCPUUtilizationPercentage: {{ .Values.user.autoscaler.targetCPUUtilizationPercentage }} \ No newline at end of file diff --git a/helm/kioku/values.yaml b/helm/kioku/values.yaml index 77a81b85..c87cf0ff 100644 --- a/helm/kioku/values.yaml +++ b/helm/kioku/values.yaml @@ -48,9 +48,9 @@ frontend_proxy: targetCPUUtilizationPercentage: 50 -login: - name: kioku-login - image: ghcr.io/kioku-project/kioku_login +carddeck: + name: kioku-carddeck + image: ghcr.io/kioku-project/kioku_carddeck tag: prod autoscaler: @@ -58,9 +58,9 @@ login: max: 10 targetCPUUtilizationPercentage: 50 -register: - name: kioku-register - image: ghcr.io/kioku-project/kioku_register +user: + name: kioku-user + image: ghcr.io/kioku-project/kioku_user tag: prod autoscaler: @@ -68,4 +68,12 @@ register: max: 10 targetCPUUtilizationPercentage: 50 +collaboration: + name: kioku-collaboration + image: ghcr.io/kioku-project/kioku_collaboration + tag: prod + autoscaler: + min: 1 + max: 10 + targetCPUUtilizationPercentage: 50