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

Add kustomization for managing remote clusters #178

Closed
wants to merge 1 commit into from
Closed
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
11 changes: 9 additions & 2 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ resources:
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required.
# - ../certmanager
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus
# - ../prometheus
# [REMOTE-CLUSTER] To configure the operator against a remote cluster, uncomment all sections with 'REMOTE-CLUSTER'.
# Another patch is necesscary to inject the remote kubeconfig into the secret.
# - remote_kubeconfig.yaml

patches:
# Protect the /metrics endpoint by putting it behind auth.
Expand All @@ -34,7 +37,11 @@ patches:

# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
- path: manager_webhook_patch.yaml
# - path: manager_webhook_patch.yaml

# [REMOTE-CLUSTER] To configure the operator against a remote cluster, uncomment all sections with 'REMOTE-CLUSTER'.
# Another patch is necesscary to inject the remote kubeconfig into the secret.
# - path: manager_remote_patch.yaml

# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
Expand Down
21 changes: 21 additions & 0 deletions config/default/manager_remote_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
spec:
template:
spec:
containers:
- args:
- --leader-elect
- --kubeconfig=/kubeconfig/kubeconfig
name: manager
volumeMounts:
- name: remote-kubeconfig
mountPath: /kubeconfig
readOnly: true
volumes:
- name: remote-kubeconfig
secret:
secretName: remote-kubeconfig
6 changes: 6 additions & 0 deletions config/default/remote_kubeconfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: Secret
metadata:
name: remote-kubeconfig
data:
kubeconfig: ""
Loading