Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for hostAliases #234

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/backstage/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ sources:
# 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: 2.1.0
version: 2.2.0
3 changes: 2 additions & 1 deletion charts/backstage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Backstage Helm Chart

[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/backstage)](https://artifacthub.io/packages/search?repo=backstage)
![Version: 2.1.0](https://img.shields.io/badge/Version-2.1.0-informational?style=flat-square)
![Version: 2.2.0](https://img.shields.io/badge/Version-2.2.0-informational?style=flat-square)
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

A Helm chart for deploying a Backstage application
Expand Down Expand Up @@ -127,6 +127,7 @@ Kubernetes: `>= 1.19.0-0`
| backstage.extraEnvVarsSecrets | Backstage container environment variables from existing Secrets | list | `[]` |
| backstage.extraVolumeMounts | Backstage container additional volume mounts | list | `[]` |
| backstage.extraVolumes | Backstage container additional volumes | list | `[]` |
| 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.digest | Backstage image digest (digest takes precedence over image tag) | string | `""` |
| 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 | `[]` |
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
37 changes: 37 additions & 0 deletions charts/backstage/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1430,6 +1430,7 @@
"type": "integer"
},
"grpc": {
"description": "GRPCAction specifies an action involving a GRPC service.",
"properties": {
"port": {
"description": "Port number of the gRPC service. Number must be in the range 1 to 65535.",
Expand Down Expand Up @@ -1620,6 +1621,7 @@
"type": "integer"
},
"grpc": {
"description": "GRPCAction specifies an action involving a GRPC service.",
"properties": {
"port": {
"description": "Port number of the gRPC service. Number must be in the range 1 to 65535.",
Expand Down Expand Up @@ -2002,6 +2004,7 @@
"type": "integer"
},
"grpc": {
"description": "GRPCAction specifies an action involving a GRPC service.",
"properties": {
"port": {
"description": "Port number of the gRPC service. Number must be in the range 1 to 65535.",
Expand Down Expand Up @@ -2979,6 +2982,7 @@
"x-kubernetes-map-type": "atomic"
},
"dataSourceRef": {
"description": "TypedObjectReference contains enough information to let you locate the typed referenced object",
"properties": {
"apiGroup": {
"description": "APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.",
Expand Down Expand Up @@ -3978,6 +3982,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 Expand Up @@ -4480,6 +4511,7 @@
"type": "integer"
},
"grpc": {
"description": "GRPCAction specifies an action involving a GRPC service.",
"properties": {
"port": {
"description": "Port number of the gRPC service. Number must be in the range 1 to 65535.",
Expand Down Expand Up @@ -4670,6 +4702,7 @@
"type": "integer"
},
"grpc": {
"description": "GRPCAction specifies an action involving a GRPC service.",
"properties": {
"port": {
"description": "Port number of the gRPC service. Number must be in the range 1 to 65535.",
Expand Down Expand Up @@ -5052,6 +5085,7 @@
"type": "integer"
},
"grpc": {
"description": "GRPCAction specifies an action involving a GRPC service.",
"properties": {
"port": {
"description": "Port number of the gRPC service. Number must be in the range 1 to 65535.",
Expand Down Expand Up @@ -5310,6 +5344,7 @@
"type": "integer"
},
"grpc": {
"description": "GRPCAction specifies an action involving a GRPC service.",
"properties": {
"port": {
"description": "Port number of the gRPC service. Number must be in the range 1 to 65535.",
Expand Down Expand Up @@ -5631,6 +5666,7 @@
"type": "integer"
},
"grpc": {
"description": "GRPCAction specifies an action involving a GRPC service.",
"properties": {
"port": {
"description": "Port number of the gRPC service. Number must be in the range 1 to 65535.",
Expand Down Expand Up @@ -5846,6 +5882,7 @@
"type": "integer"
},
"grpc": {
"description": "GRPCAction specifies an action involving a GRPC service.",
"properties": {
"port": {
"description": "Port number of the gRPC service. Number must be in the range 1 to 65535.",
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
Loading