feat(common): Release v2.3.0 (#228)

Signed-off-by: Christopher Larivière <lariviere.c@gmail.com>
Co-authored-by: Christopher Larivière <lariviere.c@gmail.com>
This commit is contained in:
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 2023-11-20 20:33:30 +01:00 committed by GitHub
parent 8bfc33eb8a
commit 0eac5ba7d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 638 additions and 17 deletions

View file

@ -3,7 +3,7 @@ apiVersion: v2
name: common
description: Function library for Helm charts
type: library
version: 2.2.0
version: 2.3.0
kubeVersion: ">=1.22.0-0"
keywords:
- common
@ -16,6 +16,19 @@ annotations:
artifacthub.io/changes: |-
- kind: added
description: |-
Add support for dependsOn to initContainers and containers.
Note that using dependsOn completely disables the "order" field within the controller.
The "order" field will be removed in v3.
Add support for `appProtocol` in Kubernetes services.
- kind: added
description: |-
Add support for route filters for HTTPRoute and GRPCRoute.
- kind: added
description: |-
Add support `dataSource` and `dataSourceRef` fields in StatefulSet volumeClaimTemplates.
- kind: added
description: |-
Add support `dataSource` and `dataSourceRef` fields in persistentVolumeClaim persistence items.
- kind: fixed
description: |-
GRPCRoute support for matches was not supported.
- kind: fixed
description: |-
`valuefrom`-style environment variables can now use Helm templating again.

View file

@ -1,6 +1,6 @@
# common
![Version: 2.2.0](https://img.shields.io/badge/Version-2.2.0-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square)
![Version: 2.3.0](https://img.shields.io/badge/Version-2.3.0-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square)
Function library for Helm charts
@ -27,7 +27,7 @@ Include this chart as a dependency in your `Chart.yaml` e.g.
# Chart.yaml
dependencies:
- name: common
version: 2.2.0
version: 2.3.0
repository: https://bjw-s.github.io/helm-charts/
```
@ -158,6 +158,8 @@ The following table contains an overview of available values and their descripti
| persistence | object | See below | Configure persistence for the chart here. Additional items can be added by adding a dictionary key similar to the 'config' key. [[ref]](https://bjw-s.github.io/helm-charts/docs/common-library/common-library-storage) |
| persistence.config.accessMode | string | `"ReadWriteOnce"` | AccessMode for the persistent volume. Make sure to select an access mode that is supported by your storage provider! [[ref]](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) |
| persistence.config.advancedMounts | object | `{}` | Explicitly configure mounts for specific controllers and containers. Example: advancedMounts: main: # the controller with the "main" identifier main: # the container with the "main" identifier - path: /data/config.yaml readOnly: true subPath: config.yaml second-container: # the container with the "second-container" identifier - path: /appdata/config readOnly: true second-controller: # the controller with the "second-controller" identifier main: # the container with the "main" identifier - path: /data/config.yaml readOnly: false subPath: config.yaml |
| persistence.config.dataSource | object | `{}` | The optional data source for the persistentVolumeClaim. [[ref]](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#volume-populators-and-data-sources) |
| persistence.config.dataSourceRef | object | `{}` | The optional volume populator for the persistentVolumeClaim. [[ref]](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#volume-populators-and-data-sources) |
| persistence.config.enabled | bool | `false` | Enables or disables the persistence item. Defaults to true |
| persistence.config.existingClaim | string | `nil` | If you want to reuse an existing claim, the name of the existing PVC can be passed here. |
| persistence.config.globalMounts | list | `[]` | Configure mounts to all controllers and containers. By default the persistence item will be mounted to `/<name_of_the_peristence_item>`. Example: globalMounts: - path: /config readOnly: false |
@ -173,7 +175,7 @@ The following table contains an overview of available values and their descripti
| route.main.labels | object | `{}` | Provide additional labels which may be required. |
| route.main.nameOverride | string | `nil` | Override the name suffix that is used for this route. |
| route.main.parentRefs | list | `[{"group":"gateway.networking.k8s.io","kind":"Gateway","name":null,"namespace":null,"sectionName":null}]` | Configure the resource the route attaches to. |
| route.main.rules | list | `[{"backendRefs":[{"group":"","kind":"Service","name":"main","namespace":null,"port":null,"weight":1}],"matches":[{"path":{"type":"PathPrefix","value":"/"}}]}]` | Configure rules for routing. Defaults to the primary service. |
| route.main.rules | list | `[{"backendRefs":[{"group":"","kind":"Service","name":"main","namespace":null,"port":null,"weight":1}],"filters":[],"matches":[{"path":{"type":"PathPrefix","value":"/"}}]}]` | Configure rules for routing. Defaults to the primary service. |
| route.main.rules[0].backendRefs | list | `[{"group":"","kind":"Service","name":"main","namespace":null,"port":null,"weight":1}]` | Configure backends where matching requests should be sent. |
| secrets | object | See below | Use this to populate secrets with the values you specify. Be aware that these values are not encrypted by default, and could therefore visible to anybody with access to the values.yaml file. Additional Secrets can be added by adding a dictionary key similar to the 'secret' object. |
| secrets.secret.annotations | object | `{}` | Annotations to add to the Secret |
@ -191,6 +193,7 @@ The following table contains an overview of available values and their descripti
| service.main.labels | object | `{}` | Provide additional labels which may be required. |
| service.main.nameOverride | string | `nil` | Override the name suffix that is used for this service |
| service.main.ports | object | See below | Configure the Service port information here. Additional ports can be added by adding a dictionary key similar to the 'http' service. |
| service.main.ports.http.appProtocol | string | `nil` | Specify the appProtocol value for the Service. [[ref]](https://kubernetes.io/docs/concepts/services-networking/service/#application-protocol) |
| service.main.ports.http.enabled | bool | `true` | Enables or disables the port |
| service.main.ports.http.nodePort | string | `nil` | Specify the nodePort value for the LoadBalancer and NodePort service types. [[ref]](https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport) |
| service.main.ports.http.port | string | `nil` | The port number |

View file

@ -44,4 +44,10 @@ spec:
{{- if $pvcObject.volumeName }}
volumeName: {{ $pvcObject.volumeName | quote }}
{{- end }}
{{- with $pvcObject.dataSource }}
dataSource: {{- tpl (toYaml .) $rootContext | nindent 10 }}
{{- end }}
{{- with $pvcObject.dataSourceRef }}
dataSourceRef: {{- tpl (toYaml .) $rootContext | nindent 10 }}
{{- end }}
{{- end -}}

View file

@ -69,11 +69,15 @@ spec:
port: {{ default .port $servicePrimaryPort.port }}
weight: {{ default 1 .weight }}
{{- end }}
{{- if (eq $routeKind "HTTPRoute") }}
{{- if or (eq $routeKind "HTTPRoute") (eq $routeKind "GRPCRoute") }}
{{- with .matches }}
matches:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .filters }}
filters:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View file

@ -90,6 +90,9 @@ spec:
{{- if (and (eq $svcType "NodePort") (not (empty $port.nodePort))) }}
nodePort: {{ $port.nodePort }}
{{ end }}
{{- if (not (empty $port.appProtocol)) }}
appProtocol: {{ $port.appProtocol }}
{{ end }}
{{- end -}}
{{- with (merge
($serviceObject.extraSelectorLabels | default dict)

View file

@ -71,7 +71,8 @@ Env field used by the container.
{{- $output = append $output (dict "name" .name "value" .value) -}}
{{- end -}}
{{- else if hasKey . "valueFrom" -}}
{{- $output = append $output (dict "name" .name "valueFrom" .valueFrom) -}}
{{- $parsedValue := (tpl (.valueFrom | toYaml) $rootContext) | fromYaml -}}
{{- $output = append $output (dict "name" .name "valueFrom" $parsedValue) -}}
{{- else -}}
{{- $output = append $output (dict "name" .name "valueFrom" (omit . "name")) -}}
{{- end -}}

View file

@ -22,6 +22,12 @@ spec:
{{- if $values.storageClass }}
storageClassName: {{ if (eq "-" $values.storageClass) }}""{{- else }}{{ $values.storageClass | quote }}{{- end }}
{{- end }}
{{- with $values.dataSource }}
dataSource: {{- tpl (toYaml .) $rootContext | nindent 10 }}
{{- end }}
{{- with $values.dataSourceRef }}
dataSourceRef: {{- tpl (toYaml .) $rootContext | nindent 10 }}
{{- end }}
{{- end -}}
{{/*

View file

@ -163,6 +163,10 @@ controllers:
# annotations: {}
# mountPath: /data
# accessMode: "ReadWriteOnce"
# dataSourceRef:
# apiGroup: snapshot.storage.k8s.io
# kind: VolumeSnapshot
# name: MySnapshot
# size: 1Gi
# - name: backup
# labels: {}
@ -453,6 +457,10 @@ service:
# [[ref]](https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport)
nodePort:
# -- Specify the appProtocol value for the Service.
# [[ref]](https://kubernetes.io/docs/concepts/services-networking/service/#application-protocol)
appProtocol:
# -- Configure the ServiceMonitors for the chart here.
# Additional ServiceMonitors can be added by adding a dictionary key similar to the 'main' ServiceMonitors.
# @default -- See below
@ -593,6 +601,8 @@ route:
- path:
type: PathPrefix
value: /
## Request filters that are applied to the rules.
filters: []
# -- Configure persistence for the chart here.
# Additional items can be added by adding a dictionary key similar to the 'config' key.
@ -616,6 +626,14 @@ persistence:
# -- If you want to reuse an existing claim, the name of the existing PVC can be passed here.
existingClaim: # your-claim
# -- The optional data source for the persistentVolumeClaim.
# [[ref]](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#volume-populators-and-data-sources)
dataSource: {}
# -- The optional volume populator for the persistentVolumeClaim.
# [[ref]](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#volume-populators-and-data-sources)
dataSourceRef: {}
# -- AccessMode for the persistent volume.
# Make sure to select an access mode that is supported by your storage provider!
# [[ref]](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes)