Skip to content

Commit

Permalink
add hostaliases to all pods
Browse files Browse the repository at this point in the history
  • Loading branch information
case0sh committed Sep 18, 2023
1 parent 07f32cd commit 914276f
Show file tree
Hide file tree
Showing 37 changed files with 50 additions and 5 deletions.
4 changes: 4 additions & 0 deletions charts/ocis/ci/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ image:
- name: some-pull-secret
nodeSelector:
kubernetes.io/arch: "amd64"
hostAliases:
- ip: "192.168.4.2"
hostnames:
- "example.kube.owncloud.test"
priorityClassName: ocis-middle-priority
jobPriorityClassName: ocis-job-middle-priority
features:
Expand Down
12 changes: 10 additions & 2 deletions charts/ocis/templates/_common/_tplvalues.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ Adds the app names to the scope and set the name of the app based on the input p
{{- $_ := set .scope "appSpecificConfig" (index .scope.Values.services (index .scope .appName)) -}}
{{- end -}}

{{- $_ := set .scope "priorityClassName" (default (default (dict) .scope.Values.priorityClassName) .scope.appSpecificConfig.priorityClassName) -}}

{{- $_ := set .scope "priorityClassName" (default (default (dict) .scope.Values.priorityClassName) .scope.appSpecificConfig.priorityClassName) -}}
{{- $_ := set .scope "jobPriorityClassName" (default (default (dict) .scope.Values.jobPriorityClassName) .scope.appSpecificConfig.jobPriorityClassName) -}}

Expand Down Expand Up @@ -245,6 +243,16 @@ oCIS serviceAccount settings
automountServiceAccountToken: true
{{- end -}}

{{/*
oCIS hostAliases settings
*/}}
{{- define "ocis.hostAliases" -}}
{{- with $.Values.hostAliases }}
hostAliases:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end -}}

{{/*
oCIS persistence dataVolumeName
*/}}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/antivirus/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ spec:
{{- include "ocis.affinity" .Values.services.antivirus | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/appprovider/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ spec:
{{- include "ocis.affinity" $.Values.services.appprovider | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" $ | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ $.appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/appregistry/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ spec:
{{- include "ocis.affinity" .Values.services.appregistry | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/audit/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ spec:
{{- include "ocis.affinity" .Values.services.audit | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/authbasic/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ spec:
{{- include "ocis.affinity" .Values.services.authbasic | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/authmachine/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ spec:
{{- include "ocis.affinity" .Values.services.authmachine | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/eventhistory/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ spec:
{{- include "ocis.affinity" .Values.services.eventhistory | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/frontend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ spec:
{{- include "ocis.affinity" .Values.services.frontend | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/gateway/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ spec:
{{- include "ocis.affinity" .Values.services.gateway | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/graph/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ spec:
{{- include "ocis.affinity" .Values.services.graph | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/groups/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ spec:
{{- include "ocis.affinity" .Values.services.groups | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/idm/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ spec:
- name: {{ include "ocis.persistence.dataVolumeName" . }}
mountPath: /var/lib/ocis
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/idp/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ spec:
{{- include "ocis.affinity" .Values.services.idp | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/nats/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ spec:
mountPath: /var/lib/ocis
{{ end }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/notifications/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ spec:
{{- include "ocis.affinity" .Values.services.notifications | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
2 changes: 1 addition & 1 deletion charts/ocis/templates/ocdav/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
{{- include "ocis.affinity" .Values.services.ocdav | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
hostAliases: {{ toYaml $.hostAliases | nindent 8 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/ocs/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ spec:
{{- include "ocis.affinity" .Values.services.ocs | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/policies/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ spec:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/postprocessing/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ spec:
{{- include "ocis.affinity" .Values.services.postprocessing | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
2 changes: 1 addition & 1 deletion charts/ocis/templates/proxy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
{{- include "ocis.affinity" .Values.services.proxy | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
hostAliases: {{ toYaml $.hostAliases | nindent 8 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/search/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ spec:
mountPath: /var/lib/ocis
{{ end }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/settings/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ spec:
{{- include "ocis.affinity" .Values.services.settings | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/sharing/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ spec:
{{- include "ocis.affinity" .Values.services.sharing | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/storagepubliclink/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ spec:
{{- include "ocis.affinity" .Values.services.storagepubliclink | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/storageshares/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ spec:
{{- include "ocis.affinity" .Values.services.storageshares | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/storagesystem/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ spec:
mountPath: /var/lib/ocis
{{ end }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/storageusers/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ spec:
mountPath: /var/lib/ocis
{{ end }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
2 changes: 2 additions & 0 deletions charts/ocis/templates/storageusers/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ spec:
{{- include "ocis.serviceAccount" . | nindent 10 }}
restartPolicy: Never
{{- include "ocis.priorityClassName" $.jobPriorityClassName | nindent 10 }}
{{- include "ocis.hostAliases" $ | nindent 10 }}
nodeSelector: {{ toYaml $.jobNodeSelector | nindent 12 }}
containers:
- name: storage-users-clean-expired-uploads
Expand Down Expand Up @@ -135,6 +136,7 @@ spec:
spec:
{{- include "ocis.serviceAccount" . | nindent 10 }}
restartPolicy: Never
{{- include "ocis.hostAliases" $ | nindent 10 }}
nodeSelector: {{ toYaml $.jobNodeSelector | nindent 12 }}
containers:
- name: storage-users-purge-expired-trash-bin-items
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/store/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ spec:
mountPath: /var/lib/ocis
{{ end }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/thumbnails/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ spec:
mountPath: /var/lib/ocis
{{ end }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/thumbnails/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ spec:
{{- include "ocis.serviceAccount" . | nindent 10 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 10 }}
{{- include "ocis.priorityClassName" $.jobPriorityClassName | nindent 10 }}
{{- include "ocis.hostAliases" $ | nindent 10 }}
nodeSelector: {{ toYaml $.jobNodeSelector | nindent 12 }}
containers:
- name: thumbnails-cleanup
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/userlog/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ spec:
{{- include "ocis.affinity" .Values.services.userlog | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/users/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ spec:
{{- include "ocis.affinity" .Values.services.users | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
1 change: 1 addition & 0 deletions charts/ocis/templates/web/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ spec:
{{- include "ocis.affinity" .Values.services.web | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down
2 changes: 1 addition & 1 deletion charts/ocis/templates/webdav/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
{{- include "ocis.affinity" .Values.services.webdav | nindent 6 }}
{{- include "ocis.securityContextAndtopologySpreadConstraints" . | nindent 6 }}
{{- include "ocis.priorityClassName" $.priorityClassName | nindent 6 }}
hostAliases: {{ toYaml $.hostAliases | nindent 8 }}
{{- include "ocis.hostAliases" $ | nindent 6 }}
nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }}
containers:
- name: {{ .appName }}
Expand Down

0 comments on commit 914276f

Please sign in to comment.