Skip to content

Commit

Permalink
feat: Allow configuring the Service IP Family policy to make it dual-…
Browse files Browse the repository at this point in the history
…stack (#252)

* feat: Allow configuring the Service IP Family policy to make it dual-stack

Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services
Signed-off-by: Armel Soro <[email protected]>

* Bump the Chart version

Signed-off-by: Armel Soro <[email protected]>

* Update values schema

Signed-off-by: Armel Soro <[email protected]>

* Add test values file for CI

Signed-off-by: Armel Soro <[email protected]>

* Run pre-commit hooks

Signed-off-by: Armel Soro <[email protected]>

---------

Signed-off-by: Armel Soro <[email protected]>
  • Loading branch information
rm3l authored Feb 23, 2025
1 parent 174eb0e commit 2df03a9
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Backstage unifies all your infrastructure tooling, services, and documentation t

This chart focuses on providing users the same experience and functionality no matter what flavor of Kubernetes they use. This chart will support only patterns that are either customary for all Kubernetes flavors, are commonly used in the Bitnami charts ecosystem, and recognized as Backstage official patterns.

We welcome other, more specialized, charts to use this cannonical chart as a direct dependency, expanding the feature set further, beyond this scope.
We welcome other, more specialized, charts to use this canonical chart as a direct dependency, expanding the feature set further, beyond this scope.

A list of derived charts:
- OpenShift specialized chart: [Red Hat Developer Hub Helm chart](https://github.com/redhat-developer/rhdh-chart/tree/main/charts/backstage)
Expand Down
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.3.1
version: 2.4.0
6 changes: 4 additions & 2 deletions 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.3.1](https://img.shields.io/badge/Version-2.3.1-informational?style=flat-square)
![Version: 2.4.0](https://img.shields.io/badge/Version-2.4.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 @@ -51,7 +51,7 @@ This chart bootstraps a [Backstage](https://backstage.io/docs/deployment/docker)

This chart focuses on providing users the same experience and functionality no matter what flavor of Kubernetes they use. This chart will support only patterns that are either customary for all Kubernetes flavors, are commonly used in the Bitnami charts ecosystem, and recognized as Backstage official patterns.

We welcome other, more specialized, charts to use this cannonical chart as a direct dependency, expanding the feature set further, beyond this scope.
We welcome other, more specialized, charts to use this canonical chart as a direct dependency, expanding the feature set further, beyond this scope.

A list of derived charts:
- OpenShift specialized chart: [Janus Backstage Helm chart](https://github.com/janus-idp/helm-backstage/tree/main/charts/backstage)
Expand Down Expand Up @@ -204,6 +204,8 @@ Kubernetes: `>= 1.19.0-0`
| service.clusterIP | Backstage service Cluster IP <br /> E.g `clusterIP: None` | string | `""` |
| service.externalTrafficPolicy | Backstage service external traffic policy Ref: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip | string | `"Cluster"` |
| service.extraPorts | Extra ports to expose in the Backstage service (normally used with the `sidecar` value) | list | `[]` |
| service.ipFamilies | IP Families <br /> Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack | list | `[]` |
| service.ipFamilyPolicy | IP Family Policy <br /> Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack | string | `""` |
| service.loadBalancerIP | Backstage service Load Balancer IP <br /> Ref: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer | string | `""` |
| service.loadBalancerSourceRanges | Load Balancer sources <br /> Ref: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer <br /> E.g `loadBalancerSourceRanges: [10.10.10.0/24]` | list | `[]` |
| service.nodePorts | Node port for the Backstage client connections Choose port between `30000-32767` | object | `{"backend":""}` |
Expand Down
2 changes: 1 addition & 1 deletion charts/backstage/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This chart bootstraps a [Backstage](https://backstage.io/docs/deployment/docker)

This chart focuses on providing users the same experience and functionality no matter what flavor of Kubernetes they use. This chart will support only patterns that are either customary for all Kubernetes flavors, are commonly used in the Bitnami charts ecosystem, and recognized as Backstage official patterns.

We welcome other, more specialized, charts to use this cannonical chart as a direct dependency, expanding the feature set further, beyond this scope.
We welcome other, more specialized, charts to use this canonical chart as a direct dependency, expanding the feature set further, beyond this scope.

A list of derived charts:
- OpenShift specialized chart: [Janus Backstage Helm chart](https://github.com/janus-idp/helm-backstage/tree/main/charts/backstage)
Expand Down
4 changes: 4 additions & 0 deletions charts/backstage/ci/service-dualstack-ip-family-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
service:
ipFamilyPolicy: PreferDualStack
ipFamilies:
- IPv4
7 changes: 7 additions & 0 deletions charts/backstage/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ spec:
{{- if .Values.service.sessionAffinity }}
sessionAffinity: {{ .Values.service.sessionAffinity }}
{{- end }}
{{- if .Values.service.ipFamilyPolicy }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
{{- with .Values.service.ipFamilies }}
ipFamilies:
{{- toYaml . | nindent 4 }}
{{- end }}
ports:
- name: {{ .Values.service.ports.name }}
port: {{ .Values.service.ports.backend }}
Expand Down
25 changes: 25 additions & 0 deletions charts/backstage/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7051,6 +7051,31 @@
"title": "Extra ports to expose in the Backstage service",
"type": "array"
},
"ipFamilies": {
"default": [],
"description": "Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services",
"items": {
"enum": [
"IPv4",
"IPv6"
],
"type": "string"
},
"title": "Backstage service IP families",
"type": "array"
},
"ipFamilyPolicy": {
"default": "",
"description": "Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services",
"enum": [
"",
"SingleStack",
"PreferDualStack",
"RequireDualStack"
],
"title": "Backstage service IP family policy",
"type": "string"
},
"loadBalancerIP": {
"default": "",
"description": "Ref: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer",
Expand Down
22 changes: 22 additions & 0 deletions charts/backstage/values.schema.tmpl.json
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,28 @@
"type": "object"
},
"default": []
},
"ipFamilyPolicy": {
"title": "Backstage service IP family policy",
"description": "Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services",
"type": "string",
"default": "",
"enum": [
"",
"SingleStack",
"PreferDualStack",
"RequireDualStack"
]
},
"ipFamilies": {
"title": "Backstage service IP families",
"description": "Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services",
"type": "array",
"items": {
"type": "string",
"enum": ["IPv4", "IPv6"]
},
"default": []
}
}
},
Expand Down
10 changes: 10 additions & 0 deletions charts/backstage/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,16 @@ service:
# -- Extra ports to expose in the Backstage service (normally used with the `sidecar` value)
extraPorts: []

# -- IP Family Policy
#
# <br /> Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack
ipFamilyPolicy: ""

# -- IP Families
#
# <br /> Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack
ipFamilies: []

## @section NetworkPolicy parameters
##
networkPolicy:
Expand Down

0 comments on commit 2df03a9

Please sign in to comment.