diff --git a/clients/harbor-client/charts/.helmignore b/clients/harbor-client/charts/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/clients/harbor-client/charts/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/clients/harbor-client/charts/Chart.yaml b/clients/harbor-client/charts/Chart.yaml index e934c4c..4227b6e 100644 --- a/clients/harbor-client/charts/Chart.yaml +++ b/clients/harbor-client/charts/Chart.yaml @@ -3,5 +3,5 @@ name: snappcloud-harbor-client description: A Helm chart for snappcloud-harbor-client type: application -version: 0.1.0 -appVersion: "0.0.1" +version: 0.1.1 +appVersion: "0.0.2" diff --git a/clients/harbor-client/charts/templates/_helpers.tpl b/clients/harbor-client/charts/templates/_helpers.tpl new file mode 100644 index 0000000..b2745d1 --- /dev/null +++ b/clients/harbor-client/charts/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "snappcloud-harbor-client.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- 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 "snappcloud-harbor-client.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "snappcloud-harbor-client.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "snappcloud-harbor-client.labels" -}} +helm.sh/chart: {{ include "snappcloud-harbor-client.chart" . }} +{{ include "snappcloud-harbor-client.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "snappcloud-harbor-client.selectorLabels" -}} +app.kubernetes.io/name: {{ include "snappcloud-harbor-client.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "snappcloud-harbor-client.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "snappcloud-harbor-client.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/clients/harbor-client/charts/templates/deployment.yaml b/clients/harbor-client/charts/templates/deployment.yaml index 8c5b6e4..0ba5ba1 100644 --- a/clients/harbor-client/charts/templates/deployment.yaml +++ b/clients/harbor-client/charts/templates/deployment.yaml @@ -11,19 +11,23 @@ spec: {{- include "snappcloud-harbor-client.selectorLabels" . | nindent 6 }} template: metadata: - labels: - {{- include "snappcloud-harbor-client.selectorLabels" . | nindent 8 }} + {{- with .Values.podAnnotations }} annotations: - {{- .Values.podAnnotations | toYaml | nindent 8 }} + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "snappcloud-harbor-client.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} spec: - serviceAccountName: {{ include "snappcloud-harbor-client.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http @@ -35,12 +39,5 @@ spec: secretKeyRef: name: {{ .Values.configSecretName }} key: IMAGE_REFERENCE - {{ .Values.nodeSelector | toYaml | nindent 8 }} - tolerations: - {{- with .Values.tolerations }} - {{- toYaml . | nindent 8 }} - {{- end }} - affinity: - {{- with .Values.affinity }} - {{- toYaml . | nindent 8 }} - {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} diff --git a/clients/harbor-client/charts/values.yaml b/clients/harbor-client/charts/values.yaml index aee0adf..215eb6e 100644 --- a/clients/harbor-client/charts/values.yaml +++ b/clients/harbor-client/charts/values.yaml @@ -3,17 +3,14 @@ replicaCount: 1 image: repository: ghcr.io/snapp-incubator/snappcloud-status-backend/clients/harbor-client pullPolicy: Always - tag: "0.0.1" + tag: "0.1.0" imagePullSecrets: [] nameOverride: "" fullnameOverride: "" -serviceAccount: - create: false - automount: true - annotations: {} - name: "" +podAnnotations: {} +podLabels: {} service: type: ClusterIP @@ -32,6 +29,5 @@ autoscaling: minReplicas: 1 maxReplicas: 100 targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 configSecretName: spcld-harbor-health-client diff --git a/clients/proxy-client/charts/.helmignore b/clients/proxy-client/charts/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/clients/proxy-client/charts/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/clients/proxy-client/charts/Chart.yaml b/clients/proxy-client/charts/Chart.yaml index fe60ee6..0a87e7b 100644 --- a/clients/proxy-client/charts/Chart.yaml +++ b/clients/proxy-client/charts/Chart.yaml @@ -3,5 +3,5 @@ name: snappcloud-proxy-client description: A Helm chart for snappcloud-proxy-client type: application -version: 0.1.0 -appVersion: "0.0.1" +version: 0.1.1 +appVersion: "0.0.2" diff --git a/clients/proxy-client/charts/templates/_helpers.tpl b/clients/proxy-client/charts/templates/_helpers.tpl new file mode 100644 index 0000000..0ffcee1 --- /dev/null +++ b/clients/proxy-client/charts/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "snappcloud-proxy-client.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- 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 "snappcloud-proxy-client.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "snappcloud-proxy-client.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "snappcloud-proxy-client.labels" -}} +helm.sh/chart: {{ include "snappcloud-proxy-client.chart" . }} +{{ include "snappcloud-proxy-client.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "snappcloud-proxy-client.selectorLabels" -}} +app.kubernetes.io/name: {{ include "snappcloud-proxy-client.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "snappcloud-proxy-client.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "snappcloud-proxy-client.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/clients/proxy-client/charts/templates/deployment.yaml b/clients/proxy-client/charts/templates/deployment.yaml index 2b4c774..0c13435 100644 --- a/clients/proxy-client/charts/templates/deployment.yaml +++ b/clients/proxy-client/charts/templates/deployment.yaml @@ -11,19 +11,23 @@ spec: {{- include "snappcloud-proxy-client.selectorLabels" . | nindent 6 }} template: metadata: - labels: - {{- include "snappcloud-proxy-client.selectorLabels" . | nindent 8 }} + {{- with .Values.podAnnotations }} annotations: - {{- .Values.podAnnotations | toYaml | nindent 8 }} + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "snappcloud-proxy-client.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} spec: - serviceAccountName: {{ include "snappcloud-proxy-client.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http @@ -35,12 +39,5 @@ spec: secretKeyRef: name: {{ .Values.configSecretName }} key: PROXY_URL - {{ .Values.nodeSelector | toYaml | nindent 8 }} - tolerations: - {{- with .Values.tolerations }} - {{- toYaml . | nindent 8 }} - {{- end }} - affinity: - {{- with .Values.affinity }} - {{- toYaml . | nindent 8 }} - {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} diff --git a/clients/proxy-client/charts/values.yaml b/clients/proxy-client/charts/values.yaml index a562e00..9ccdd91 100644 --- a/clients/proxy-client/charts/values.yaml +++ b/clients/proxy-client/charts/values.yaml @@ -3,17 +3,14 @@ replicaCount: 1 image: repository: ghcr.io/snapp-incubator/snappcloud-status-backend/clients/proxy-client pullPolicy: Always - tag: "0.0.1" + tag: "0.1.0" imagePullSecrets: [] nameOverride: "" fullnameOverride: "" -serviceAccount: - create: false - automount: true - annotations: {} - name: "" +podAnnotations: {} +podLabels: {} service: type: ClusterIP @@ -32,6 +29,5 @@ autoscaling: minReplicas: 1 maxReplicas: 100 targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 configSecretName: spcld-proxy-health-client diff --git a/clients/proxy-client/deploy/Chart.yaml b/clients/proxy-client/deploy/Chart.yaml deleted file mode 100644 index bf35679..0000000 --- a/clients/proxy-client/deploy/Chart.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v2 -name: snappcloud-proxy-client -description: A Helm chart for Kubernetes - -type: application -version: 0.1.0 -appVersion: "0.0.1" diff --git a/clients/proxy-client/deploy/templates/deployment.yaml b/clients/proxy-client/deploy/templates/deployment.yaml deleted file mode 100644 index 2b4c774..0000000 --- a/clients/proxy-client/deploy/templates/deployment.yaml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "snappcloud-proxy-client.fullname" . }} - labels: - {{- include "snappcloud-proxy-client.labels" . | nindent 4 }} -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "snappcloud-proxy-client.selectorLabels" . | nindent 6 }} - template: - metadata: - labels: - {{- include "snappcloud-proxy-client.selectorLabels" . | nindent 8 }} - annotations: - {{- .Values.podAnnotations | toYaml | nindent 8 }} - spec: - serviceAccountName: {{ include "snappcloud-proxy-client.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: http - containerPort: 80 - protocol: TCP - env: - - name: PROXY_URL - valueFrom: - secretKeyRef: - name: {{ .Values.configSecretName }} - key: PROXY_URL - {{ .Values.nodeSelector | toYaml | nindent 8 }} - tolerations: - {{- with .Values.tolerations }} - {{- toYaml . | nindent 8 }} - {{- end }} - affinity: - {{- with .Values.affinity }} - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/clients/proxy-client/deploy/templates/secret.yaml b/clients/proxy-client/deploy/templates/secret.yaml deleted file mode 100644 index 67599b5..0000000 --- a/clients/proxy-client/deploy/templates/secret.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: {{ .Values.configSecretName }} - labels: - {{- include "snappcloud-proxy-client.labels" . | nindent 4 }} -type: Opaque -stringData: - PROXY_URL: "The proxy address." diff --git a/clients/proxy-client/deploy/templates/service.yaml b/clients/proxy-client/deploy/templates/service.yaml deleted file mode 100644 index 337d0a1..0000000 --- a/clients/proxy-client/deploy/templates/service.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "snappcloud-proxy-client.fullname" . }} - labels: - {{- include "snappcloud-proxy-client.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - selector: - {{- include "snappcloud-proxy-client.selectorLabels" . | nindent 4 }} diff --git a/clients/proxy-client/deploy/values.yaml b/clients/proxy-client/deploy/values.yaml deleted file mode 100644 index ef6843e..0000000 --- a/clients/proxy-client/deploy/values.yaml +++ /dev/null @@ -1,37 +0,0 @@ -replicaCount: 1 - -image: - repository: ghcr.io/snapp-incubator/snappcloud-status-backend - pullPolicy: Always - tag: "0.0.1" - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - create: false - automount: true - annotations: {} - name: "" - -service: - type: ClusterIP - port: 8080 - -resources: - limits: - cpu: 100m - memory: 128Mi - requests: - cpu: 100m - memory: 128Mi - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -configSecretName: spcld-proxy-health-client