Skip to content

Commit b62746a

Browse files
authored
Allow custom signer signingCA to specify namespace in addOnTemplate (#350)
Signed-off-by: zhujian <[email protected]>
1 parent 05ff7c1 commit b62746a

3 files changed

+18
-11
lines changed

addon/v1alpha1/0000_03_addon.open-cluster-management.io_addontemplates.crd.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,15 +372,19 @@ spec:
372372
signingCA:
373373
description: |-
374374
SigningCA represents the reference of the secret on the hub cluster to sign the CSR
375-
the secret must be in the namespace where the addon-manager is located, and the secret
376-
type must be "kubernetes.io/tls"
375+
the secret type must be "kubernetes.io/tls"
377376
Note: The addon manager will not have permission to access the secret by default, so
378-
the user must grant the permission to the addon manager(by creating rolebinding for
379-
the addon-manager serviceaccount "addon-manager-controller-sa").
377+
the user must grant the permission to the addon manager(by creating rolebinding/clusterrolebinding
378+
for the addon-manager serviceaccount "addon-manager-controller-sa").
380379
properties:
381380
name:
382381
description: Name of the signing CA secret
383382
type: string
383+
namespace:
384+
description: Namespace of the signing CA secret, the
385+
namespace of the addon-manager will be used if it
386+
is not set.
387+
type: string
384388
required:
385389
- name
386390
type: object

addon/v1alpha1/types_addontemplate.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,10 @@ type CustomSignerRegistrationConfig struct {
170170
Subject *Subject `json:"subject,omitempty"`
171171

172172
// SigningCA represents the reference of the secret on the hub cluster to sign the CSR
173-
// the secret must be in the namespace where the addon-manager is located, and the secret
174-
// type must be "kubernetes.io/tls"
173+
// the secret type must be "kubernetes.io/tls"
175174
// Note: The addon manager will not have permission to access the secret by default, so
176-
// the user must grant the permission to the addon manager(by creating rolebinding for
177-
// the addon-manager serviceaccount "addon-manager-controller-sa").
175+
// the user must grant the permission to the addon manager(by creating rolebinding/clusterrolebinding
176+
// for the addon-manager serviceaccount "addon-manager-controller-sa").
178177
// +kubebuilder:validation:Required
179178
SigningCA SigningCARef `json:"signingCA"`
180179
}
@@ -185,6 +184,9 @@ type SigningCARef struct {
185184
// Name of the signing CA secret
186185
// +kubebuilder:validation:Required
187186
Name string `json:"name"`
187+
// Namespace of the signing CA secret, the namespace of the addon-manager will be used if it is not set.
188+
// +optional
189+
Namespace string `json:"namespace,omitempty"`
188190
}
189191

190192
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

addon/v1alpha1/zz_generated.swagger_doc_generated.go

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)