Skip to content

Latest commit

 

History

History
175 lines (141 loc) · 8.27 KB

deploy-controller.md

File metadata and controls

175 lines (141 loc) · 8.27 KB

Deploying the CSI-Addons Controller

The CSI-Addons Controller can be deployed by different ways:

Configuration

Available command-line arguments:

Option Default value Description
--metrics-bind-address :8080 The address the metric endpoint binds to.
--health-probe-bind-address :8081 The address the probe endpoint binds to.
--leader-elect false Enable leader election for controller manager.
--reclaim-space-timeout 3m Timeout for reclaimspace operation
--max-concurrent-reconciles 100 Maximum number of concurrent reconciles
--enable-admission-webhooks true Enable the admission webhooks

Note: Some of the above configuration options can also be configured using "csi-addons-config" configmap.

Installation for versioned deployments

The CSI-Addons Controller can also be installed using the yaml files in deploy/controller. The versioned deployment is possible with the yaml files that get generated for the latest release. You can download the yaml files from there, or use them directly with kubectl. This is the recommended and easiest way to deploy the controller.

$ cd deploy/controller

$ kubectl create -f crds.yaml
...
customresourcedefinition.apiextensions.k8s.io/csiaddonsnodes.csiaddons.openshift.io created
customresourcedefinition.apiextensions.k8s.io/networkfences.csiaddons.openshift.io created
customresourcedefinition.apiextensions.k8s.io/reclaimspacecronjobs.csiaddons.openshift.io created
customresourcedefinition.apiextensions.k8s.io/reclaimspacejobs.csiaddons.openshift.io created

$ kubectl create -f rbac.yaml
...
serviceaccount/csi-addons-controller-manager created
role.rbac.authorization.k8s.io/csi-addons-leader-election-role created
clusterrole.rbac.authorization.k8s.io/csi-addons-manager-role created
clusterrole.rbac.authorization.k8s.io/csi-addons-metrics-reader created
clusterrole.rbac.authorization.k8s.io/csi-addons-proxy-role created
rolebinding.rbac.authorization.k8s.io/csi-addons-leader-election-rolebinding created
clusterrolebinding.rbac.authorization.k8s.io/csi-addons-manager-rolebinding created
clusterrolebinding.rbac.authorization.k8s.io/csi-addons-proxy-rolebinding created
configmap/csi-addons-manager-config created
service/csi-addons-controller-manager-metrics-service created

$ kubectl create -f setup-controller.yaml
...
deployment.apps/csi-addons-controller-manager created
  • The "crds.yaml" create the required crds for reclaimspace operation.

  • The "rbac.yaml" creates the required rbac.

  • The "setup-controller.yaml" creates the csi-addons-controller-manager.

Webhooks are disabled by default in the controller deployment. If you are looking to install controller with webhooks enabled, a single yaml file is available in deploy/controller which contains all the required RBAC, CRD, Deployment, Webhooks, Certificates etc. The versioned deployment is possible with the yaml files that get generated for the latest release. You can download the yaml file from there, or use them directly with kubectl. This is the recommended and easiest way to deploy the controller with webhooks.

Note The cert-manager need to be available/installed before installing the controller. Please refer doc for cert-manager installation.

$ cd deploy/controller

$ kubectl create -f install-all-in-one.yaml

namespace/csi-addons-system created
customresourcedefinition.apiextensions.k8s.io/csiaddonsnodes.csiaddons.openshift.io created
customresourcedefinition.apiextensions.k8s.io/networkfences.csiaddons.openshift.io created
customresourcedefinition.apiextensions.k8s.io/reclaimspacecronjobs.csiaddons.openshift.io created
customresourcedefinition.apiextensions.k8s.io/reclaimspacejobs.csiaddons.openshift.io created
customresourcedefinition.apiextensions.k8s.io/volumereplicationclasses.replication.storage.openshift.io created
customresourcedefinition.apiextensions.k8s.io/volumereplications.replication.storage.openshift.io created
serviceaccount/csi-addons-controller-manager created
role.rbac.authorization.k8s.io/csi-addons-leader-election-role created
clusterrole.rbac.authorization.k8s.io/csi-addons-manager-role created
clusterrole.rbac.authorization.k8s.io/csi-addons-metrics-reader created
clusterrole.rbac.authorization.k8s.io/csi-addons-proxy-role created
rolebinding.rbac.authorization.k8s.io/csi-addons-leader-election-rolebinding created
clusterrolebinding.rbac.authorization.k8s.io/csi-addons-manager-rolebinding created
clusterrolebinding.rbac.authorization.k8s.io/csi-addons-proxy-rolebinding created
configmap/csi-addons-manager-config created
service/csi-addons-controller-manager-metrics-service created
service/csi-addons-webhook-service created
deployment.apps/csi-addons-controller-manager created
certificate.cert-manager.io/csi-addons-serving-cert created
issuer.cert-manager.io/csi-addons-selfsigned-issuer created
validatingwebhookconfiguration.admissionregistration.k8s.io/csi-addons-validating-webhook-configuration created

Installation by operator-sdk

A CSI-Addons bundle can be used to install the CSI-Addons Controller with the following steps:

kubectl create namespace storage-csi-addons
make operator-sdk
./bin/operator-sdk run bundle -n storage-csi-addons quay.io/csiaddons/k8s-bundle:latest

In the future, the bundle is expected to become available in the OperatorHub.

Installation with kustomize

This project uses kustomize and a Makefile for deploying. By running the command

$ make deploy
...
customresourcedefinition.apiextensions.k8s.io/csiaddonsnodes.csiaddons.openshift.io created
customresourcedefinition.apiextensions.k8s.io/reclaimspacejobs.csiaddons.openshift.io created
serviceaccount/csi-addons-controller-manager created
role.rbac.authorization.k8s.io/csi-addons-leader-election-role created
clusterrole.rbac.authorization.k8s.io/csi-addons-manager-role created
clusterrole.rbac.authorization.k8s.io/csi-addons-metrics-reader created
clusterrole.rbac.authorization.k8s.io/csi-addons-proxy-role created
rolebinding.rbac.authorization.k8s.io/csi-addons-leader-election-rolebinding created
clusterrolebinding.rbac.authorization.k8s.io/csi-addons-manager-rolebinding created
clusterrolebinding.rbac.authorization.k8s.io/csi-addons-proxy-rolebinding created
configmap/csi-addons-manager-config created
service/csi-addons-controller-manager-metrics-service created
deployment.apps/csi-addons-controller-manager created

the different components for the Controller will get deployed in the csi-addons-system Namespace.

$ kubectl -n csi-addons-system get all
NAME                                                 READY   STATUS    RESTARTS   AGE
pod/csi-addons-controller-manager-687d47b8c7-9m56f   2/2     Running   0          49s

NAME                                                    TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
service/csi-addons-controller-manager-metrics-service   ClusterIP   172.30.153.17   <none>        8443/TCP   49s

NAME                                            READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/csi-addons-controller-manager   1/1     1            1           49s

NAME                                                       DESIRED   CURRENT   READY   AGE
replicaset.apps/csi-addons-controller-manager-687d47b8c7   1         1         1       49s

Resource Requirements

The resource requirements for the CSI-Addons Controller depends on the number of PersistentVolumeClaims, Pods, Nodes and CSI-Addons CRs that are deployed in the cluster. The resource requirements can be adjusted by the user depending on the requirements of the cluster after observation. The default resource requirements for the CSI-Addons Controller are as follows:

        resources:
          limits:
            cpu: 1000m
            memory: 512Mi
          requests:
            cpu: 10m
            memory: 64Mi