Skip to content

Commit

Permalink
deploy: generate setup-controller.yaml from config/manager
Browse files Browse the repository at this point in the history
This commit adds capability to generate setup-controller.yaml
containing only configmap and controller deployment.
it moves manager_auth_proxy patch to config/manager and
performs other required changes.

Signed-off-by: Rakshith R <[email protected]>
  • Loading branch information
Rakshith-R authored and mergify[bot] committed Feb 3, 2022
1 parent 9cf0159 commit e707f76
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 981 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,10 @@ help: ## Display this help.
.PHONY: manifests
manifests: controller-gen kustomize ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="{./api/...,./cmd/...,./controllers/...,./sidecar/...}" output:crd:artifacts:config=config/crd/bases
cd config/default && $(KUSTOMIZE) edit set image rbac-proxy=${RBAC_PROXY_IMG}
cd config/manager && $(KUSTOMIZE) edit set image controller=${CONTROLLER_IMG}
cd config/manager && $(KUSTOMIZE) edit set image controller=${CONTROLLER_IMG} rbac-proxy=${RBAC_PROXY_IMG}
$(KUSTOMIZE) build config/crd > deploy/controller/crds.yaml
$(KUSTOMIZE) build config/rbac > deploy/controller/rbac.yaml
$(KUSTOMIZE) build config/default > deploy/controller/setup-controller.yaml
$(KUSTOMIZE) build config/manager > deploy/controller/setup-controller.yaml

# generate the <package-name>.clusterserviceversion.yaml
config/manifests/bases/$(PACKAGE_NAME).clusterserviceversion.yaml: config/manifests/bases/clusterserviceversion.yaml.in
Expand Down
11 changes: 1 addition & 10 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus

# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
patchesStrategicMerge:
- manager_auth_proxy_patch.yaml

# patchesStrategicMerge:
# Mount the controller config file for loading manager configurations
# through a ComponentConfig type
#- manager_config_patch.yaml
Expand Down Expand Up @@ -60,10 +55,6 @@ patchesStrategicMerge:
# version: v1
# name: webhook-service

images:
- name: rbac-proxy
newName: gcr.io/kubebuilder/kube-rbac-proxy
newTag: v0.8.0
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
Expand Down
9 changes: 9 additions & 0 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ namePrefix: csi-addons-
resources:
- manager.yaml

# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
patchesStrategicMerge:
- manager_auth_proxy_patch.yaml

generatorOptions:
disableNameSuffixHash: true

Expand All @@ -24,3 +30,6 @@ images:
- name: controller
newName: quay.io/csiaddons/k8s-controller
newTag: latest
- name: rbac-proxy
newName: gcr.io/kubebuilder/kube-rbac-proxy
newTag: v0.8.0
2 changes: 1 addition & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ spec:
requests:
cpu: 10m
memory: 64Mi
serviceAccountName: controller-manager
serviceAccountName: csi-addons-controller-manager
terminationGracePeriodSeconds: 10
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ spec:
- containerPort: 8443
protocol: TCP
name: https
# TODO(user): Configure the resources accordingly based on the project requirements.
# More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 10m
memory: 64Mi
- name: manager
args:
- "--health-probe-bind-address=:8081"
Expand Down
Loading

0 comments on commit e707f76

Please sign in to comment.