Skip to content
Snippets Groups Projects
Commit 110b3ff0 authored by maik.schaefer's avatar maik.schaefer
Browse files

Integrate ox common

parent 9d448077
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,10 @@ manifests:
ingress:
enabled: false
defaultRegistry: ""
image:
registry: ""
repository: ${CI_REGISTRY_IMAGE}
pullPolicy: Always
tag: ${TAG_NAME}
......
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"
......@@ -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"
{{- define "core-manifest-service.ingressPathMappings" -}}
paths:
- path: /
{{- end -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "core-manifest-service.fullname" . }}
name: {{ include "ox-common.names.fullname" . }}
data:
urls.yaml: |
manifests:
......
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" . }}
{{- 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 }}
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 }}
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment