Skip to content

Commit f0a6bcb

Browse files
authored
Extend helm-chart with backend & docs (#502)
* Add configurable backend deployment * Add helm docs * bump helm version --------- Signed-off-by: Mangirdas Judeikis <mangirdas@judeikis.lt> On-behalf-of: SAP <mangirdas.judeikis@sap.com>
1 parent d84ef9c commit f0a6bcb

7 files changed

Lines changed: 287 additions & 58 deletions

File tree

Makefile

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ DEX_VERSION := v2.43.1
3535
GOLANGCI_LINT_VERSION := 2.1.6
3636
GORELEASER_VERSION := 2.13.0
3737
GOTESTSUM_VERSION := 1.8.1
38+
HELM_DOCS_VERSION := 1.14.2
3839
HELM_VERSION := 3.18.6
3940
# unreleased kcp version with vw code for schemas
4041
KCP_VERSION := 301a8f749e7b99a0c81f43b37aa5b5e5ff0fc0b4
@@ -175,6 +176,14 @@ install-goreleaser:
175176
install-helm:
176177
@hack/uget.sh https://get.helm.sh/helm-v{VERSION}-{GOOS}-{GOARCH}.tar.gz helm $(HELM_VERSION)
177178

179+
HELM_DOCS = $(UGET_DIRECTORY)/helm-docs-$(HELM_DOCS_VERSION)
180+
181+
.PHONY: install-helm-docs
182+
install-helm-docs: export OS ?= $(shell uname -s)
183+
install-helm-docs: export ARCH ?= $(shell uname -m)
184+
install-helm-docs:
185+
@hack/uget.sh https://github.com/norwoodj/helm-docs/releases/download/v{VERSION}/helm-docs_{VERSION}_{ENV:OS}_{ENV:ARCH}.tar.gz helm-docs $(HELM_DOCS_VERSION) helm-docs
186+
178187
# e2e tests use this env name to locate the dex binary; make sure it's an absolute path
179188
export DEX_BINARY = $(ROOT_DIR)/$(UGET_DIRECTORY)/dex-$(DEX_VERSION)
180189

@@ -364,7 +373,7 @@ verify-modules: modules # Verify go modules are up to date
364373
done
365374

366375
.PHONY: verify
367-
verify: verify-go-versions verify-modules verify-imports verify-codegen verify-boilerplate ## verify formal properties of the code
376+
verify: verify-go-versions verify-modules verify-imports verify-codegen verify-boilerplate verify-helm-docs ## verify formal properties of the code
368377

369378
.PHONY: help
370379
help: ## Show this help
@@ -442,4 +451,16 @@ helm-push-local: ## Push Helm charts to IMAGE_REPO registry
442451
helm-test: helm-build-local ## Test Helm chart installation (dry-run)
443452
@hack/helm-test.sh
444453

454+
.PHONY: generate-helm-docs
455+
generate-helm-docs: install-helm-docs ## Generate Helm chart documentation
456+
$(HELM_DOCS) --chart-search-root deploy/charts
457+
458+
.PHONY: verify-helm-docs
459+
verify-helm-docs: generate-helm-docs ## Verify Helm chart documentation is up to date
460+
@if ! git diff --quiet HEAD -- deploy/charts/**/README.md; then \
461+
git diff -- deploy/charts/**/README.md; \
462+
echo "Helm chart documentation is out of date, please run 'make generate-helm-docs'"; \
463+
exit 1; \
464+
fi
465+
445466
include Makefile.venv

deploy/charts/backend/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ version: 0.1.0
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "v0.6.0"
24+
appVersion: "v0.7.1"

deploy/charts/backend/README.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# backend
2+
3+
A Helm chart for kube-bind backend deployment
4+
5+
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.7.1](https://img.shields.io/badge/AppVersion-v0.7.1-informational?style=flat-square)
6+
7+
## Installation
8+
9+
```bash
10+
helm install kube-bind-backend oci://ghcr.io/kube-bind/charts/backend --version <version>
11+
```
12+
13+
## Configuration
14+
15+
See [values.yaml](values.yaml) for the full list of configurable parameters.
16+
17+
## Values
18+
19+
| Key | Type | Default | Description |
20+
|-----|------|---------|-------------|
21+
| affinity | object | `{}` | Affinity rules for pod scheduling |
22+
| autoscaling.enabled | bool | `false` | Enable horizontal pod autoscaling |
23+
| autoscaling.maxReplicas | int | `100` | Maximum number of replicas |
24+
| autoscaling.minReplicas | int | `1` | Minimum number of replicas |
25+
| autoscaling.targetCPUUtilizationPercentage | int | `80` | Target CPU utilization percentage |
26+
| backend.apibindingIgnorePrefixes | list | `[]` | Name prefixes of APIBindings to ignore when generating APIServiceExportTemplates |
27+
| backend.apiexportEndpointSliceName | string | `""` | APIExport EndpointSlice name to watch |
28+
| backend.clusterScopeIsolation | string | `"prefix"` | Cluster-scope isolation mode. Options: none, prefix, namespaced |
29+
| backend.consumerScope | string | `"namespaced"` | Consumer scope. Options: "namespaced" |
30+
| backend.cookieEncryptionKey | string | `""` | Cookie encryption key (base64 encoded). Empty generates random key on each start (not for production!) |
31+
| backend.cookieSigningKey | string | `""` | Cookie signing key (base64 encoded). Empty generates random key on each start (not for production!) |
32+
| backend.externalAddress | string | `""` | External address clients use to reach the backend |
33+
| backend.externalServerName | string | `""` | External server name for TLS SNI |
34+
| backend.extraArgs | list | `[]` | Extra command-line arguments to pass to the backend |
35+
| backend.frontendDisabled | bool | `false` | Disable the frontend UI |
36+
| backend.listenAddress | string | `"0.0.0.0:8080"` | Address the backend listens on |
37+
| backend.loggingLevel | int | `2` | Logging verbosity level |
38+
| backend.multiclusterRuntimeProvider | string | `""` | Multicluster runtime provider (e.g., "kcp") |
39+
| backend.namespacePrefix | string | `"kube-bind-"` | Prefix for namespaces created by kube-bind |
40+
| backend.oidc.allowedGroups | list | `[]` | List of groups allowed to access bindings. With embedded OIDC, system:authenticated is added automatically |
41+
| backend.oidc.allowedUsers | list | `[]` | List of users allowed to access bindings |
42+
| backend.oidc.callbackUrl | string | `""` | OIDC callback URL |
43+
| backend.oidc.clientId | string | `""` | OIDC client ID |
44+
| backend.oidc.clientSecret | string | `""` | OIDC client secret (plaintext, prefer clientSecretName for production) |
45+
| backend.oidc.clientSecretKey | string | `""` | Key within the secret (e.g., "client-secret") |
46+
| backend.oidc.clientSecretName | string | `""` | Name of the Kubernetes secret containing the OIDC client secret |
47+
| backend.oidc.issuerUrl | string | `""` | OIDC issuer URL (leave empty for embedded OIDC server) |
48+
| backend.oidc.type | string | `"embedded"` | OIDC provider type. Options: "embedded" or "external" |
49+
| backend.prettyName | string | `""` | Human-readable name for this backend instance |
50+
| backend.schemaSource | string | `""` | Schema source (e.g., "apiresourceschemas") |
51+
| backend.tls.certSecretName | string | `""` | Name of the Kubernetes secret containing TLS certificate |
52+
| backend.tls.enabled | bool | `false` | Enable TLS for the backend |
53+
| backend.tls.tlsCertFile | string | `"/etc/kube-bind/tls/tls.crt"` | Path to TLS certificate file inside the container |
54+
| backend.tls.tlsKeyFile | string | `"/etc/kube-bind/tls/tls.key"` | Path to TLS key file inside the container |
55+
| certManager.clusterIssuer | string | `""` | Name of the ClusterIssuer to use |
56+
| certManager.enabled | bool | `false` | Enable cert-manager integration for automatic TLS certificates |
57+
| examples.enabled | bool | `false` | Enable example resources to seed on first start |
58+
| fullnameOverride | string | `""` | Override the full release name |
59+
| gatewayApi.enabled | bool | `false` | Enable Gateway API resources |
60+
| gatewayApi.gateway.annotations | object | `{}` | Annotations to add to the Gateway resource |
61+
| gatewayApi.gateway.className | string | `""` | Gateway class name |
62+
| gatewayApi.gateway.httpPort | int | `80` | HTTP listener port |
63+
| gatewayApi.gateway.httpsPort | int | `443` | HTTPS listener port |
64+
| gatewayApi.gateway.tls.certificateRefs | list | `[]` | TLS certificate references for the Gateway |
65+
| gatewayApi.route.annotations | object | `{}` | Annotations to add to the HTTPRoute resource |
66+
| gatewayApi.route.hostnames | list | `[]` | Hostnames for the HTTPRoute |
67+
| gatewayApi.route.path | string | `"/"` | Path match for the HTTPRoute |
68+
| gatewayApi.route.pathType | string | `"PathPrefix"` | Path match type for the HTTPRoute |
69+
| hostAliases | list | `[]` | Host aliases for /etc/hosts injection into pods |
70+
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
71+
| image.repository | string | `"ghcr.io/kube-bind/backend"` | Image repository |
72+
| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion |
73+
| imagePullSecrets | list | `[]` | Secrets for pulling images from a private repository |
74+
| initContainers | list | `[]` | Additional init containers |
75+
| livenessProbe | object | `{"httpGet":{"path":"/healthz","port":"http"}}` | Liveness probe configuration |
76+
| nameOverride | string | `""` | Override the chart name |
77+
| nodeSelector | object | `{}` | Node selector for pod scheduling |
78+
| podAnnotations | object | `{}` | Annotations to add to the pod |
79+
| podLabels | object | `{}` | Labels to add to the pod |
80+
| podSecurityContext | object | `{}` | Pod security context |
81+
| rbac.create | bool | `true` | Specifies whether RBAC resources should be created |
82+
| readinessProbe | object | `{"httpGet":{"path":"/healthz","port":"http"}}` | Readiness probe configuration |
83+
| replicaCount | int | `1` | Number of replicas for the backend deployment |
84+
| resources | object | `{}` | Resource requests and limits |
85+
| securityContext | object | `{}` | Container security context |
86+
| service.httpsNodePort | string | `""` | NodePort for HTTPS (only used when type is NodePort) |
87+
| service.httpsPort | int | `8443` | HTTPS service port |
88+
| service.nodePort | string | `""` | NodePort for HTTP (only used when type is NodePort) |
89+
| service.port | int | `8080` | HTTP service port |
90+
| service.type | string | `"ClusterIP"` | Service type |
91+
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
92+
| serviceAccount.automount | bool | `true` | Automatically mount the ServiceAccount's API credentials |
93+
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
94+
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
95+
| tolerations | list | `[]` | Tolerations for pod scheduling |
96+
| volumeMounts | list | `[]` | Additional volumeMounts on the output Deployment definition |
97+
| volumes | list | `[]` | Additional volumes on the output Deployment definition |
98+
99+
---
100+
101+
*This README is generated by [helm-docs](https://github.com/norwoodj/helm-docs). Do not edit manually.*
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{ template "chart.header" . }}
2+
3+
{{ template "chart.description" . }}
4+
5+
{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }}
6+
7+
## Installation
8+
9+
```bash
10+
helm install kube-bind-backend oci://ghcr.io/kube-bind/charts/backend --version <version>
11+
```
12+
13+
## Configuration
14+
15+
See [values.yaml](values.yaml) for the full list of configurable parameters.
16+
17+
{{ template "chart.requirementsSection" . }}
18+
19+
{{ template "chart.valuesSection" . }}
20+
21+
{{ template "chart.maintainersSection" . }}
22+
23+
---
24+
25+
*This README is generated by [helm-docs](https://github.com/norwoodj/helm-docs). Do not edit manually.*

deploy/charts/backend/templates/deployment.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ spec:
3636
hostAliases:
3737
{{- toYaml . | nindent 8 }}
3838
{{- end }}
39+
{{- with .Values.initContainers }}
40+
initContainers:
41+
{{- toYaml . | nindent 8 }}
42+
{{- end }}
3943
containers:
4044
- name: {{ .Chart.Name }}
4145
{{- with .Values.securityContext }}
@@ -112,6 +116,24 @@ spec:
112116
- --oidc-allowed-users={{ . }}
113117
{{- end }}
114118
{{- end }}
119+
{{- if .Values.backend.multiclusterRuntimeProvider }}
120+
- --multicluster-runtime-provider={{ .Values.backend.multiclusterRuntimeProvider }}
121+
{{- end }}
122+
{{- if .Values.backend.schemaSource }}
123+
- --schema-source={{ .Values.backend.schemaSource }}
124+
{{- end }}
125+
{{- if .Values.backend.apiexportEndpointSliceName }}
126+
- --apiexport-endpoint-slice-name={{ .Values.backend.apiexportEndpointSliceName }}
127+
{{- end }}
128+
{{- if .Values.backend.frontendDisabled }}
129+
- --frontend-disabled=true
130+
{{- end }}
131+
{{- range .Values.backend.apibindingIgnorePrefixes }}
132+
- --apibinding-ignore-prefixes={{ . }}
133+
{{- end }}
134+
{{- range .Values.backend.extraArgs }}
135+
- {{ . }}
136+
{{- end }}
115137
{{- if .Values.backend.loggingLevel }}
116138
- -v={{ .Values.backend.loggingLevel }}
117139
{{- end }}

0 commit comments

Comments
 (0)