diff --git a/.gitlab-ci/values.yaml b/.gitlab-ci/values.yaml index d5989617f1df988b72b72a53e9103fdb25f85dd4..1337231dfa3c9c1bbbf3f9867867277f60f633ce 100644 --- a/.gitlab-ci/values.yaml +++ b/.gitlab-ci/values.yaml @@ -8,7 +8,10 @@ manifests: ingress: enabled: false +defaultRegistry: "" + image: + registry: "" repository: ${CI_REGISTRY_IMAGE} pullPolicy: Always tag: ${TAG_NAME} diff --git a/helm/core-manifest-service/Chart.lock b/helm/core-manifest-service/Chart.lock new file mode 100644 index 0000000000000000000000000000000000000000..a309de300d75604f455268986220a28199f36a8a --- /dev/null +++ b/helm/core-manifest-service/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: ox-common + repository: oci://registry.open-xchange.com//common/charts + version: 1.0.9 +digest: sha256:e204cbfc5c68f4cd492bd4c5eaa87ad685ed1403e921b05c0fb2498b0aa9f299 +generated: "2021-10-13T16:00:59.193216+02:00" diff --git a/helm/core-manifest-service/Chart.yaml b/helm/core-manifest-service/Chart.yaml index ac277f4dd64cc3f450febc2048f1f6d010f80be8..3c30b595724699a49a56e7dc05f68a0338a4010f 100644 --- a/helm/core-manifest-service/Chart.yaml +++ b/helm/core-manifest-service/Chart.yaml @@ -15,10 +15,14 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.1.0 +version: 2.0.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. appVersion: "1.1.0" +dependencies: + - name: ox-common + version: 1.0.9 + repository: "oci://registry.open-xchange.com//common/charts" diff --git a/helm/core-manifest-service/templates/_ingress.tpl b/helm/core-manifest-service/templates/_ingress.tpl new file mode 100644 index 0000000000000000000000000000000000000000..8df12d9dd400e0c4d406e26203a8e73fc18b7adc --- /dev/null +++ b/helm/core-manifest-service/templates/_ingress.tpl @@ -0,0 +1,4 @@ +{{- define "core-manifest-service.ingressPathMappings" -}} +paths: + - path: / +{{- end -}} diff --git a/helm/core-manifest-service/templates/configMap.yaml b/helm/core-manifest-service/templates/configMap.yaml index 1d216feca3ee11f8d7ea21fc4f8dc70ece02a97d..9a09801831ccf161c0000270c219a6b89d7eda42 100644 --- a/helm/core-manifest-service/templates/configMap.yaml +++ b/helm/core-manifest-service/templates/configMap.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "core-manifest-service.fullname" . }} + name: {{ include "ox-common.names.fullname" . }} data: urls.yaml: | manifests: diff --git a/helm/core-manifest-service/templates/deployment.yaml b/helm/core-manifest-service/templates/deployment.yaml index afd15251bb7e8a28e72347b28790f7d1853a9abf..5eca31e3ee20dcd40d7afad79a505d56d0b35881 100644 --- a/helm/core-manifest-service/templates/deployment.yaml +++ b/helm/core-manifest-service/templates/deployment.yaml @@ -1,41 +1,24 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "core-manifest-service.fullname" . }} + name: {{ include "ox-common.names.fullname" . }} labels: - {{- include "core-manifest-service.labels" . | nindent 4 }} - {{- with .Values.deploymentAnnotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} + {{- include "ox-common.labels.standard" . | nindent 4 }} spec: - {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} - {{- end }} selector: matchLabels: - {{- include "core-manifest-service.selectorLabels" . | nindent 6 }} + {{- include "ox-common.labels.matchLabels" . | nindent 6 }} template: metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} + annotations: {{ toYaml .Values.podAnnotations | nindent 8 }} labels: - {{- include "core-manifest-service.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "core-manifest-service.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- include "ox-common.labels.matchLabels" . | nindent 8 }} + spec: {{ include "ox-common.pods.podSpec" (dict "podRoot" .Values "global" $ "context" . ) | nindent 6 }} containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + - name: main + securityContext: {{ toYaml .Values.securityContext | nindent 12 }} + image: {{ include "ox-common.images.image" (dict "imageRoot" .Values.image "global" $ "context" . ) }} imagePullPolicy: {{ .Values.image.pullPolicy }} env: - name: CACHE_TTL @@ -46,14 +29,20 @@ spec: - name: http containerPort: {{ .Values.containerPort | default 8080 }} protocol: TCP + {{- if .Values.probe.liveness.enabled }} livenessProbe: httpGet: - path: /healthy + path: / port: http + {{- omit .Values.probe.liveness "enabled" | toYaml | nindent 12 }} + {{- end }} + {{- if .Values.probe.readiness.enabled }} readinessProbe: httpGet: - path: /ready - port: http + path: / + port: http + {{- omit .Values.probe.readiness "enabled" | toYaml | nindent 12 }} + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: @@ -62,16 +51,5 @@ spec: volumes: - name: manifest-config configMap: - name: {{ include "core-manifest-service.fullname" . }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} + name: {{ include "ox-common.names.fullname" . }} + diff --git a/helm/core-manifest-service/templates/ingress.yaml b/helm/core-manifest-service/templates/ingress.yaml index c965713d1b57fee1b395e36b949ff4220622cc64..027e9ac3fa918c72d4b0c93414d7cee9e1529e68 100644 --- a/helm/core-manifest-service/templates/ingress.yaml +++ b/helm/core-manifest-service/templates/ingress.yaml @@ -1,61 +1,3 @@ {{- if .Values.ingress.enabled -}} -{{- $fullName := include "core-manifest-service.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "core-manifest-service.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} +{{ include "ox-common.ingress.defaultIngress" (dict "ingress" .Values.ingress "context" . "global" $) }} {{- end }} diff --git a/helm/core-manifest-service/templates/service.yaml b/helm/core-manifest-service/templates/service.yaml index 551297ead34a582630ac36f6146c149c873cd739..47649d77875bcf19863fb290d714ec3045bcc085 100644 --- a/helm/core-manifest-service/templates/service.yaml +++ b/helm/core-manifest-service/templates/service.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "core-manifest-service.fullname" . }} + name: {{ include "ox-common.names.fullname" . }} labels: - {{- include "core-manifest-service.labels" . | nindent 4 }} + {{- include "ox-common.labels.standard" . | nindent 4 }} spec: type: {{ .Values.service.type }} ports: @@ -12,4 +12,4 @@ spec: protocol: TCP name: http selector: - {{- include "core-manifest-service.selectorLabels" . | nindent 4 }} + {{- include "ox-common.labels.matchLabels" . | nindent 4 }} diff --git a/helm/core-manifest-service/values.yaml b/helm/core-manifest-service/values.yaml index b61318334fad37b5561ef6a943a52b2bac24ffaf..a2476fbf0b7a822e4209f5e54fd98f6813fc4200 100644 --- a/helm/core-manifest-service/values.yaml +++ b/helm/core-manifest-service/values.yaml @@ -4,10 +4,12 @@ replicaCount: 1 +defaultRegistry: registry.open-xchange.com + containerPort: 8080 image: - repository: gitlab.open-xchange.com:4567/frontend/infrastructure/manifest-service + repository: "core-manifest-service" pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "" @@ -44,15 +46,13 @@ service: ingress: enabled: true - className: "" + pathMappings: "core-manifest-service.ingressPathMappings" annotations: {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" hosts: - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific + tls: [] # - secretName: chart-example-tls # hosts: @@ -83,6 +83,18 @@ tolerations: [] affinity: {} -# service specific configuration +probe: + liveness: + enabled: true + periodSeconds: 10 + failureThreshold: 15 + + readiness: + enabled: true + initialDelaySeconds: 30 + periodSeconds: 5 + failureThreshold: 2 + timeoutSeconds: 5 + cacheTTL: 30000 logLevel: info