diff --git a/Makefile b/Makefile index 034a303..f72e28f 100644 --- a/Makefile +++ b/Makefile @@ -103,6 +103,11 @@ uninstall: ## Run helm uninstall. reinstall: uninstall install ## Run helm reinstall. +deploy: reinstall ## deploy helm chart. + +render: ## Render helm chart. + @helm template . + package: ## Package the helm chart. @helm package . --destination dist diff --git a/README.md b/README.md index 24e049d..1d2cfcf 100644 --- a/README.md +++ b/README.md @@ -80,3 +80,4 @@ helm uninstall fcoscore Any new contribution is more than welcome in this project! If you want to know more about the development workflow or want to contribute, please visit our [contributing guidelines](/CONTRIBUTING.md) for detailed instructions! + diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index c8c2595..9d4d6d6 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -159,6 +159,37 @@ If release name contains chart name it will be used as a full name. {{- end -}} {{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "fcoscore.inbox.fullname" -}} +{{- printf "%s-inbox" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{- define "fcoscore.inbox.port" -}} +{{- .Values.inbox.service.port | quote -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "fcoscore.tarantool.fullname" -}} +{{- printf "%s-tarantool" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{- define "fcoscore.tarantool.port" -}} +{{- .Values.tarantool.service.port -}} +{{- end -}} + +{{- define "fcoscore.tarantool.host" -}} +{{- printf "%s:%s" (include "fcoscore.tarantool.fullname" . ) ( include "fcoscore.tarantool.port" . ) -}} +{{- end -}} + {{/* Return the Fab City Core secret name */}} diff --git a/templates/frontend/deployment.yaml b/templates/frontend/deployment.yaml index 7654675..f254188 100644 --- a/templates/frontend/deployment.yaml +++ b/templates/frontend/deployment.yaml @@ -32,7 +32,7 @@ spec: - name: {{ include "fcoscore.frontend.fullname" . }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.frontend.repository }}:{{ .Values.frontend.tag | default .Chart.AppVersion }}" + image: "{{ .Values.frontend.registry }}/{{ .Values.frontend.repository }}:{{ .Values.frontend.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.frontend.pullPolicy }} {{- if .Values.lifecycleHooks }} lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }} diff --git a/templates/gateway/deployment.yaml b/templates/gateway/deployment.yaml index 53679f8..2488fa9 100644 --- a/templates/gateway/deployment.yaml +++ b/templates/gateway/deployment.yaml @@ -32,7 +32,7 @@ spec: - name: {{ include "fcoscore.gateway.fullname" . }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.gateway.repository }}:{{ .Values.gateway.tag | default .Chart.AppVersion }}" + image: "{{ .Values.gateway.registry }}/{{ .Values.gateway.repository }}:{{ .Values.gateway.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.gateway.pullPolicy }} {{- if .Values.lifecycleHooks }} lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }} diff --git a/templates/inbox/deployment.yaml b/templates/inbox/deployment.yaml new file mode 100644 index 0000000..29e6faf --- /dev/null +++ b/templates/inbox/deployment.yaml @@ -0,0 +1,67 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "fcoscore.inbox.fullname" . }} + labels: + {{- include "fcoscore.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + app: {{ include "fcoscore.inbox.fullname" . }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + app: {{ include "fcoscore.inbox.fullname" . }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "fcoscore.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ include "fcoscore.inbox.fullname" . }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.inbox.registry }}/{{ .Values.inbox.repository }}:{{ .Values.inbox.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.inbox.pullPolicy }} + {{- if .Values.lifecycleHooks }} + lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.containerSecurityContext.enabled }} + securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }} + {{- end }} + {{- if .Values.diagnosticMode.enabled }} + command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} + {{- else if .Values.command }} + command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.diagnosticMode.enabled }} + args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} + {{- else if .Values.args }} + args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }} + {{- end }} + env: + - name: PORT + value: {{ template "fcoscore.inbox.port" . }} + - name: TT_HOST + value: {{ template "fcoscore.tarantool.host" . }} + - name: TT_USER + value: inbox + - name: TT_PASS + value: inbox + ports: + - name: http + containerPort: {{ .Values.inbox.service.port }} + protocol: TCP + resources: + {{- toYaml .Values.resources | nindent 12 }} diff --git a/templates/inbox/hpa.yaml b/templates/inbox/hpa.yaml new file mode 100644 index 0000000..c8a9169 --- /dev/null +++ b/templates/inbox/hpa.yaml @@ -0,0 +1,29 @@ +--- +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "fcoscore.inbox.fullname" . }} + labels: + {{- include "fcoscore.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "fcoscore.inbox.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/templates/inbox/service.yaml b/templates/inbox/service.yaml new file mode 100644 index 0000000..92d170a --- /dev/null +++ b/templates/inbox/service.yaml @@ -0,0 +1,15 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "fcoscore.inbox.fullname" . }} + labels: {{- include "fcoscore.labels" . | nindent 4 }} +spec: + type: {{ .Values.inbox.service.type }} + ports: + - port: {{ .Values.inbox.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + app: {{ include "fcoscore.inbox.fullname" . }} diff --git a/templates/tarantool/deployment.yaml b/templates/tarantool/deployment.yaml new file mode 100644 index 0000000..3d4ad06 --- /dev/null +++ b/templates/tarantool/deployment.yaml @@ -0,0 +1,58 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "fcoscore.tarantool.fullname" . }} + labels: + {{- include "fcoscore.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + app: {{ include "fcoscore.tarantool.fullname" . }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + app: {{ include "fcoscore.tarantool.fullname" . }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "fcoscore.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ include "fcoscore.tarantool.fullname" . }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.tarantool.registry }}/{{ .Values.tarantool.repository }}:{{ .Values.tarantool.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.tarantool.pullPolicy }} + {{- if .Values.lifecycleHooks }} + lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.containerSecurityContext.enabled }} + securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }} + {{- end }} + {{- if .Values.diagnosticMode.enabled }} + command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} + {{- else if .Values.command }} + command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.diagnosticMode.enabled }} + args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} + {{- else if .Values.args }} + args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }} + {{- end }} + ports: + - name: http + containerPort: {{ .Values.tarantool.service.port }} + protocol: TCP + resources: + {{- toYaml .Values.resources | nindent 12 }} diff --git a/templates/tarantool/hpa.yaml b/templates/tarantool/hpa.yaml new file mode 100644 index 0000000..ce67f72 --- /dev/null +++ b/templates/tarantool/hpa.yaml @@ -0,0 +1,29 @@ +--- +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "fcoscore.tarantool.fullname" . }} + labels: + {{- include "fcoscore.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "fcoscore.tarantool.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/templates/tarantool/service.yaml b/templates/tarantool/service.yaml new file mode 100644 index 0000000..1bf1e51 --- /dev/null +++ b/templates/tarantool/service.yaml @@ -0,0 +1,17 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "fcoscore.tarantool.fullname" . }} + labels: {{- include "fcoscore.labels" . | nindent 4 }} +spec: + type: {{ .Values.tarantool.service.type }} + ports: + - port: {{ .Values.tarantool.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + app: {{ include "fcoscore.tarantool.fullname" . }} + + diff --git a/templates/zenflow/deployment.yaml b/templates/zenflow/deployment.yaml index abf1428..378a33f 100644 --- a/templates/zenflow/deployment.yaml +++ b/templates/zenflow/deployment.yaml @@ -32,7 +32,7 @@ spec: - name: {{ include "fcoscore.zenflow.fullname" . }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.zenflow.repository }}:{{ .Values.zenflow.tag | default .Chart.AppVersion }}" + image: "{{ .Values.zenflow.registry }}/{{ .Values.zenflow.repository }}:{{ .Values.zenflow.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.zenflow.pullPolicy }} {{- if .Values.lifecycleHooks }} lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }} diff --git a/templates/zvmlet/deployment.yaml b/templates/zvmlet/deployment.yaml index 3ed7ce6..bd9fa74 100644 --- a/templates/zvmlet/deployment.yaml +++ b/templates/zvmlet/deployment.yaml @@ -32,7 +32,7 @@ spec: - name: {{ include "fcoscore.zvmlet.fullname" . }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.zvmlet.repository }}:{{ .Values.zvmlet.tag | default .Chart.AppVersion }}" + image: "{{ .Values.zvmlet.registry }}/{{ .Values.zvmlet.repository }}:{{ .Values.zvmlet.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.zvmlet.pullPolicy }} {{- if .Values.lifecycleHooks }} lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }} diff --git a/values.yaml b/values.yaml index 4d2027f..24aabc4 100644 --- a/values.yaml +++ b/values.yaml @@ -176,8 +176,8 @@ affinity: {} ## @param image.debug Enable image debug mode ## zenflow: - registry: docker.io - repository: fabcityhamburg/zenflows + registry: ghcr.io + repository: interfacerproject/zenflows ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -195,7 +195,7 @@ zenflow: ## # Overrides the image tag whose default is the chart appVersion. # tag: "" - tag: "" + tag: master secretName: "" existingSecret: "" debug: false @@ -206,8 +206,8 @@ zenflow: salt: "" zvmlet: - registry: docker.io - repository: fabcityhamburg/zvmlet + registry: ghcr.io + repository: interfacerproject/zenflows-crypto ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -224,15 +224,15 @@ zvmlet: ## Set to true if you would like to see extra information on logs ## # Overrides the image tag whose default is the chart appVersion. - tag: "" + tag: latest debug: false service: type: ClusterIP port: 3000 frontend: - registry: docker.io - repository: fabcityhamburg/interfacer-gui + registry: ghcr.io + repository: interfacerproject/interfacer-gui ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -249,15 +249,15 @@ frontend: ## Set to true if you would like to see extra information on logs ## # Overrides the image tag whose default is the chart appVersion. - tag: "" + tag: main debug: false service: type: ClusterIP port: 8080 gateway: - registry: docker.io - repository: fabcityhamburg/interfacer-gateway + registry: ghcr.io + repository: interfacerproject/interfacer-gateway ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -274,13 +274,65 @@ gateway: ## Set to true if you would like to see extra information on logs ## # Overrides the image tag whose default is the chart appVersion. - tag: "" + tag: main debug: false service: type: ClusterIP port: 3000 url: "" +inbox: + registry: ghcr.io + repository: interfacerproject/zenflows-inbox-tarantool + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## e.g: + ## pullSecrets: + ## - myRegistryKeySecretName + ## + pullSecrets: [] + ## Set to true if you would like to see extra information on logs + ## + # Overrides the image tag whose default is the chart appVersion. + tag: main + debug: false + service: + type: ClusterIP + port: 8080 + url: "" + +tarantool: + registry: ghcr.io + repository: interfacerproject/zenflows-inbox-tarantool-db + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## e.g: + ## pullSecrets: + ## - myRegistryKeySecretName + ## + pullSecrets: [] + ## Set to true if you would like to see extra information on logs + ## + # Overrides the image tag whose default is the chart appVersion. + tag: main + debug: false + service: + type: ClusterIP + port: 3500 + url: "" + ## Persistence Parameters ## ref: https://kubernetes.io/docs/user-guide/persistent-volumes/ ##