Skip to content

Commit

Permalink
Add configmap to local setup and mount the volume
Browse files Browse the repository at this point in the history
  • Loading branch information
nesmabadr committed Jan 13, 2025
1 parent 4111539 commit 09274b0
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
22 changes: 22 additions & 0 deletions config/maintenance_windows/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

configMapGenerator:
- name: maintenance-config
files:
- policy.json

generatorOptions:
disableNameSuffixHash: true

patches:
- path: patches/volume_mount.yaml

transformers:
- |-
apiVersion: builtin
kind: NamespaceTransformer
metadata:
name: add-maintwindows-cm-to-kcp-system
namespace: kcp-system
unsetOnly: true
17 changes: 17 additions & 0 deletions config/maintenance_windows/patches/volume_mount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
spec:
template:
spec:
containers:
- name: manager
volumeMounts:
- name: maintenance-policy
mountPath: /etc/maintenance-policy
readOnly: true
volumes:
- name: maintenance-policy
configMap:
name: maintenance-config
7 changes: 7 additions & 0 deletions config/maintenance_windows/policy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"default": {
"begin": "13:00:00Z",
"end": "17:00:00Z",
"days": ["Wed", "Fri"]
}
}
1 change: 1 addition & 0 deletions config/watcher_local_test/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ resources:
# [ISTIO] To enable istio, uncomment all sections with 'ISTIO'.
components:
- ../istio
- ../maintenance_windows


generatorOptions:
Expand Down

0 comments on commit 09274b0

Please sign in to comment.