Skip to content

Commit

Permalink
Add support for hostAliases
Browse files Browse the repository at this point in the history
Signed-off-by: Joel Damata <damatj@pointclickcare.com>
  • Loading branch information
jdamata authored and coreydaley committed Nov 11, 2024
1 parent 560f425 commit 8053d5e
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/backstage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ Kubernetes: `>= 1.19.0-0`
| backstage.extraVolumeMounts | Backstage container additional volume mounts | list | `[]` |
| backstage.extraVolumes | Backstage container additional volumes | list | `[]` |
| backstage.image.digest | Backstage image digest (digest takes precedence over image tag) | string | `""` |
| backstage.hostAliases | Host Aliases for the pod <br /> Ref: https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/ | list | `[]` |
| backstage.image.pullPolicy | Specify a imagePullPolicy. Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' <br /> Ref: https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy | string | `"Always"` |
| backstage.image.pullSecrets | Optionally specify an array of imagePullSecrets. Secrets must be manually created in the namespace. <br /> Ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ <br /> E.g: `pullSecrets: [myRegistryKeySecretName]` | list | `[]` |
| backstage.image.registry | Backstage image registry | string | `"ghcr.io"` |
Expand Down
4 changes: 4 additions & 0 deletions charts/backstage/templates/backstage-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ spec:
tolerations:
{{- include "common.tplvalues.render" ( dict "value" .Values.backstage.tolerations "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.backstage.hostAliases }}
hostAliases:
{{- include "common.tplvalues.render" ( dict "value" .Values.backstage.hostAliases "context" $) | nindent 8 }}
{{- end }}
volumes:
{{- if (or .Values.backstage.extraAppConfig (and .Values.backstage.extraVolumeMounts .Values.backstage.extraVolumes)) }}
{{- range .Values.backstage.extraAppConfig }}
Expand Down
27 changes: 27 additions & 0 deletions charts/backstage/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3978,6 +3978,33 @@
"title": "Backstage container additional volumes",
"type": "array"
},
"hostAliases": {
"default": [],
"description": "Ref: https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/#adding-additional-entries-with-hostaliases",
"items": {
"description": "HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.",
"properties": {
"hostnames": {
"description": "Hostnames for the above IP address.",
"items": {
"type": "string"
},
"type": "array",
"x-kubernetes-list-type": "atomic"
},
"ip": {
"description": "IP address of the host file entry.",
"type": "string"
}
},
"required": [
"ip"
],
"type": "object"
},
"title": "Adding entries to a Pod's /etc/hosts file provides Pod-level override of hostname resolution when DNS and other options are not applicable",
"type": "array"
},
"image": {
"additionalProperties": false,
"properties": {
Expand Down
9 changes: 9 additions & 0 deletions charts/backstage/values.schema.tmpl.json
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,15 @@
},
"default": []
},
"hostAliases": {
"title": "Adding entries to a Pod's /etc/hosts file provides Pod-level override of hostname resolution when DNS and other options are not applicable",
"description": "Ref: https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/#adding-additional-entries-with-hostaliases",
"type": "array",
"items": {
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/master/_definitions.json#/definitions/io.k8s.api.core.v1.HostAlias"
},
"default": []
},
"podAnnotations": {
"title": "Annotations to add to the backend deployment pods",
"type": "object",
Expand Down
4 changes: 4 additions & 0 deletions charts/backstage/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ backstage:
# value: "value"
# effect: "NoSchedule|PreferNoSchedule|NoExecute"

# -- Host Aliases for the pod
# <br /> Ref: https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/
hostAliases: []

# -- Annotations to add to the backend deployment pods
podAnnotations: {}

Expand Down

0 comments on commit 8053d5e

Please sign in to comment.