Skip to content

Commit

Permalink
Merge pull request #146 from qinqon/kustomize-base-per-overlay
Browse files Browse the repository at this point in the history
kustomize: Create different base per overlay
  • Loading branch information
kubevirt-bot authored Sep 7, 2022
2 parents 193a41b + c90d23f commit d7b4760
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 68 deletions.
7 changes: 0 additions & 7 deletions config/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
bases:
- ../rbac
- ../manager
- ../secret

generatorOptions:
disableNameSuffixHash: true

patchesStrategicMerge:
- manager_tenant_kubeconfig_secret_patch.yaml
File renamed without changes.
25 changes: 25 additions & 0 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
bases:
- ../base

patchesJson6902:
- patch: |-
- op: add
path: /metadata/namespace
value: kube-system
- op: add
path: /subjects/0/namespace
value: default
target:
group: rbac.authorization.k8s.io
version: v1
kind: RoleBinding
name: kccm-extension-apiserver-authorization-reader

generatorOptions:
disableNameSuffixHash: true

configMapGenerator:
- name: cloud-config
namespace: default
files:
- cloud-config
File renamed without changes.
33 changes: 33 additions & 0 deletions config/isolated/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
bases:
- ../base

patches:
- patch: |-
- op: add
path: /spec/template/spec/containers/0/args/-
value: --authentication-skip-lookup=true
target:
kind: Deployment

patchesStrategicMerge:
- |-
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kccm
$patch: delete
- |-
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kccm
$patch: delete
generatorOptions:
disableNameSuffixHash: true

configMapGenerator:
- name: cloud-config
namespace: default
files:
- cloud-config
6 changes: 6 additions & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ spec:
- configMap:
name: cloud-config
name: cloud-config
- secret:
secretName: kubeconfig
items:
- key: kubeconfig
path: value
name: kubeconfig
nodeSelector:
node-role.kubernetes.io/master: ""
tolerations:
Expand Down
29 changes: 3 additions & 26 deletions config/overlays/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
namespace: default
bases:
- ../../base

patchesJson6902:
- patch: |-
- op: add
path: /metadata/namespace
value: kube-system
- op: add
path: /subjects/0/namespace
value: default
target:
group: rbac.authorization.k8s.io
version: v1
kind: RoleBinding
name: kccm-extension-apiserver-authorization-reader

generatorOptions:
disableNameSuffixHash: true

configMapGenerator:
- name: cloud-config
namespace: default
files:
- cloud-config
bases:
- ../../secret
- ../../default
37 changes: 3 additions & 34 deletions config/overlays/isolated/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,3 @@
namespace: default
bases:
- ../../base

patches:
- patch: |-
- op: add
path: /spec/template/spec/containers/0/args/-
value: --authentication-skip-lookup=true
target:
kind: Deployment

patchesStrategicMerge:
- |-
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kccm
$patch: delete
- |-
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kccm
$patch: delete
generatorOptions:
disableNameSuffixHash: true

configMapGenerator:
- name: cloud-config
namespace: default
files:
- cloud-config
bases:
- ../../secret
- ../../isolated
3 changes: 2 additions & 1 deletion config/overlays/kubevirtci/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace: kvcluster
bases:
- ../isolated
- ../../secret
- ../../isolated

patchesStrategicMerge:
- manager_image_patch.yaml

0 comments on commit d7b4760

Please sign in to comment.