Skip to content

Commit 29a9317

Browse files
committed
add multicluster access provider options to Helm chart
Signed-off-by: kahirokunn <okinakahiro@gmail.com> Made-with: Cursor
1 parent a11261e commit 29a9317

4 files changed

Lines changed: 93 additions & 2 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright 2026 The Knative Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
{{- $mc := .Values.knative_operator.knative_operator.multicluster | default dict }}
16+
{{- if $mc.enabled }}
17+
{{- $mountPaths := list }}
18+
{{- range ($mc.plugins | default (list)) }}
19+
{{- $mountPaths = append $mountPaths .mountPath }}
20+
{{- end }}
21+
{{- $cfg := $mc.accessProvidersConfig | default dict }}
22+
{{- range ($cfg.providers | default (list)) }}
23+
{{- $cmd := (.execConfig | default dict).command | default "" }}
24+
{{- if $cmd }}
25+
{{- $cmdDir := dir $cmd }}
26+
{{- if not (has $cmdDir $mountPaths) }}
27+
{{- fail (printf "multicluster validation error: provider %q command %q has parent dir %q which does not match any plugins[].mountPath (have %v); execConfig.command parent directory must equal a plugin mountPath" .name $cmd $cmdDir $mountPaths) }}
28+
{{- end }}
29+
{{- end }}
30+
{{- end }}
31+
apiVersion: v1
32+
kind: ConfigMap
33+
metadata:
34+
name: credential-providers-config
35+
namespace: "{{ .Release.Namespace }}"
36+
labels:
37+
app.kubernetes.io/name: knative-operator
38+
app.kubernetes.io/version: "{{ .Chart.Version }}"
39+
data:
40+
config.json: {{ $mc.accessProvidersConfig | default dict | mustToJson | quote }}
41+
{{- end }}

config/charts/knative-operator/templates/operator.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,5 +855,31 @@ spec:
855855
ports:
856856
- name: metrics
857857
containerPort: 9090
858+
{{- $mc := .Values.knative_operator.knative_operator.multicluster | default dict }}
859+
{{- if $mc.enabled }}
860+
args:
861+
- --credential-providers-config=/etc/cluster-inventory/config.json
862+
volumeMounts:
863+
- name: cred-config
864+
mountPath: /etc/cluster-inventory
865+
readOnly: true
866+
{{- range ($mc.plugins | default list) }}
867+
- name: {{ .name }}
868+
mountPath: {{ .mountPath }}
869+
readOnly: true
870+
{{- end }}
871+
{{- end }}
872+
{{- $mc := .Values.knative_operator.knative_operator.multicluster | default dict }}
873+
{{- if $mc.enabled }}
874+
volumes:
875+
- name: cred-config
876+
configMap:
877+
name: credential-providers-config
878+
{{- range ($mc.plugins | default list) }}
879+
- name: {{ .name }}
880+
image:
881+
reference: {{ .image }}
882+
{{- end }}
883+
{{- end }}
858884

859885
---

config/charts/knative-operator/values.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,25 @@ knative_operator:
1515
limits:
1616
cpu: 1000m
1717
memory: 1000Mi
18+
# Multi-cluster (Cluster Inventory API): when enabled, the chart mounts
19+
# access provider config and optional plugin images, and sets
20+
# --credential-providers-config on the operator. ClusterProfile.status
21+
# accessProviders are not managed by this chart.
22+
multicluster:
23+
enabled: false
24+
accessProvidersConfig: {}
25+
plugins: []
26+
# accessProvidersConfig:
27+
# providers:
28+
# - name: token-secretreader
29+
# execConfig:
30+
# apiVersion: client.authentication.k8s.io/v1
31+
# command: /credential-plugins/token-secretreader/kubeconfig-secretreader-plugin
32+
# provideClusterInfo: true
33+
# plugins:
34+
# - name: token-secretreader
35+
# image: ghcr.io/example/plugin:v1.0.0
36+
# mountPath: /credential-plugins/token-secretreader
1837
operator_webhook:
1938
image: gcr.io/knative-releases/knative.dev/operator/cmd/webhook
2039
tag: {{ tag }}

docs/release.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ spec:
8585
...
8686
- name: KUBERNETES_MIN_VERSION
8787
value: "{{ .Values.knative_operator.kubernetes_min_version }}"
88-
...
88+
...
8989
```
9090

9191
and
@@ -106,7 +106,7 @@ spec:
106106
...
107107
- name: KUBERNETES_MIN_VERSION
108108
value: "{{ .Values.knative_operator.kubernetes_min_version }}"
109-
...
109+
...
110110
```
111111

112112
You need to remove the line containing `logging.request-log-template:`, because the value of this key contains `{{ }}` in the example,
@@ -128,3 +128,8 @@ helm install knative-operator ./knative-operator-{version}.tgz
128128
```
129129

130130
Replace `{version}` with the correct version for your artifact.
131+
132+
For multi-cluster installs using `spec.clusterProfileRef` on `KnativeServing` / `KnativeEventing`, set
133+
`knative_operator.knative_operator.multicluster.enabled` to `true` in `values.yaml` and provide
134+
`multicluster.accessProvidersConfig` (structured YAML; rendered to the operator's `config.json`) and
135+
`multicluster.plugins` (image volume mounts for exec plugins).

0 commit comments

Comments
 (0)