Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NO-JIRA: Centralize injection of hosted-kubeconfig volume #311

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- op: add
path: /spec/template/spec/volumes/-
value:
name: hosted-kubeconfig
secret:
defaultMode: 420
secretName: service-network-admin-kubeconfig
2 changes: 1 addition & 1 deletion assets/common/hypershift/sidecar_add_kubeconfig.yaml.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Add --kubeconfig param + volume for the guest kubeconfig.
# Using json patch because stratigc merge cannot merge podSpec.containers.args.
# Using json patch because stratgic merge cannot merge podSpec.containers.args.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: strategic 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gdi 😅

- op: add
path: /spec/template/spec/containers/0/args/-
value:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
# livenessprobe.yaml: Added arguments [--probe-timeout=3s]
# Applied strategic merge patch livenessprobe.yaml
# Applied strategic merge patch common/hypershift/controller_add_affinity_tolerations.yaml
# Applied JSON patch common/hypershift/controller_add_kubeconfig_volume.yaml.patch
# Applied strategic merge patch overlays/aws-ebs/patches/controller_add_hypershift_controller_minter.yaml
#
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,3 @@ spec:
emptyDir:
medium: Memory
projected: null # Explicity overwrite existing projected: with null in strategic merge patch
- name: hosted-kubeconfig
secret:
defaultMode: 420
secretName: service-network-admin-kubeconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
# livenessprobe.yaml: Added arguments [--probe-timeout=3s]
# Applied strategic merge patch livenessprobe.yaml
# Applied strategic merge patch common/hypershift/controller_add_affinity_tolerations.yaml
# Applied JSON patch common/hypershift/controller_add_kubeconfig_volume.yaml.patch
# Applied strategic merge patch overlays/azure-disk/patches/controller_add_hypershift_controller.yaml
#
#
Expand Down Expand Up @@ -401,13 +402,13 @@ spec:
- name: metrics-serving-cert
secret:
secretName: azure-disk-csi-driver-controller-metrics-serving-cert
- emptyDir:
medium: Memory
name: bound-sa-token
- name: hosted-kubeconfig
secret:
defaultMode: 420
secretName: service-network-admin-kubeconfig
- emptyDir:
medium: Memory
name: bound-sa-token
- name: cloud-config
secret:
secretName: azure-disk-csi-config
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,3 @@ spec:
- name: metrics-serving-cert
secret:
secretName: azure-disk-csi-driver-controller-metrics-serving-cert

Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ spec:
emptyDir:
medium: Memory
projected: null # Explicity overwrite existing projected: with null in strategic merge patch
- name: hosted-kubeconfig
secret:
defaultMode: 420
secretName: service-network-admin-kubeconfig
- name: cloud-config
secret:
secretName: azure-disk-csi-config
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
# livenessprobe.yaml: Added arguments [--probe-timeout=3s]
# Applied strategic merge patch livenessprobe.yaml
# Applied strategic merge patch common/hypershift/controller_add_affinity_tolerations.yaml
# Applied JSON patch common/hypershift/controller_add_kubeconfig_volume.yaml.patch
# Applied JSON patch common/hypershift/sidecar_add_kubeconfig.yaml.patch
# Applied strategic merge patch overlays/azure-file/patches/controller_add_hypershift_controller.yaml
# Applied JSON patch overlays/azure-file/patches/controller_add_driver_kubeconfig_hypershift.yaml.patch
#
#

Expand Down Expand Up @@ -407,13 +408,13 @@ spec:
- name: metrics-serving-cert
secret:
secretName: azure-file-csi-driver-controller-metrics-serving-cert
- emptyDir:
medium: Memory
name: bound-sa-token
- name: hosted-kubeconfig
secret:
defaultMode: 420
secretName: service-network-admin-kubeconfig
- emptyDir:
medium: Memory
name: bound-sa-token
- name: cloud-config
secret:
secretName: azure-file-csi-config

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ spec:
emptyDir:
medium: Memory
projected: null # Explicity overwrite existing projected: with null in strategic merge patch
- name: hosted-kubeconfig
secret:
defaultMode: 420
secretName: service-network-admin-kubeconfig
- name: cloud-config
secret:
secretName: azure-file-csi-config
1 change: 0 additions & 1 deletion assets/overlays/azure-file/patches/node_add_driver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,3 @@ spec:
- serviceAccountToken:
path: token
audience: openshift

4 changes: 3 additions & 1 deletion pkg/driver/azure-file/azure_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ func GetAzureFileGeneratorConfig() *generator.CSIDriverGeneratorConfig {
},
Assets: commongenerator.DefaultControllerAssets,
AssetPatches: commongenerator.DefaultAssetPatches.WithPatches(generator.HyperShiftOnly,
// despite naming suggesting this is for sidecar containers, it can actually be used for any
// pod and we happen to need the guest kubeconfig for the azure-file CSI driver
"controller.yaml", "common/hypershift/sidecar_add_kubeconfig.yaml.patch",
"controller.yaml", "overlays/azure-file/patches/controller_add_hypershift_controller.yaml",
"controller.yaml", "overlays/azure-file/patches/controller_add_driver_kubeconfig_hypershift.yaml.patch",
).WithPatches(generator.StandaloneOnly,
"controller.yaml", "overlays/azure-file/patches/controller_add_standalone_injector.yaml",
),
Expand Down
1 change: 1 addition & 0 deletions pkg/driver/common/generator/base_assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ var (
).WithPatches(generator.HyperShiftOnly,
"controller_sa.yaml", "common/hypershift/controller_sa_pull_secret.yaml",
"controller.yaml", "common/hypershift/controller_add_affinity_tolerations.yaml",
"controller.yaml", "common/hypershift/controller_add_kubeconfig_volume.yaml.patch",
)
)

Expand Down