Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deployment/mcad-controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ namespace: kube-system
replicaCount: 1
loglevel: 4
image:
repository: mcad-controller
tag: latest
repository: darroyo/mcad-controller
tag: quota-management-v1.29.40
pullPolicy: Always

crd:
Expand Down
73 changes: 48 additions & 25 deletions doc/deploy/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ Server Version: v1.11.9
#
```
### - Install the Helm Package Manager
Install the Helm Client on your local machine and the Helm Cerver on your kubernetes cluster. Helm installation documentation is [here]
(https://docs.helm.sh/using_helm/#installing-helm). After you install Helm you can list the Help packages installed with the following command:
Install the Helm Client on your local machine and the Helm Cerver on your kubernetes cluster. Helm installation documentation is [here](https://helm.sh/docs/intro/install/). After you install Helm you can list the Help packages installed with the following command:
```
# helm list
# helm ls --all-namespaces --all
#
```

Expand Down Expand Up @@ -95,50 +94,73 @@ or
```
### 2. Navigate to the Helm Deployment Directory.
```
cd multi-cluster-app-wrapper/deployment
cd multi-cluster-app-dispatcher/deployment/mcad-controller
```
### 3.a. Branch checkout
Checkout quota management branch using:
```
git clone https://github.com/IBM/multi-cluster-app-dispatcher.git -b quota-management
```

### 3. Run the installation using Helm.
### 3.b. Run the installation using Helm.
Install the __Multi-Cluster-App-Dispatcher Controller__ using the commands below. The `--wait` parameter in the Helm command below is used to ensure all pods of the helm chart are running and will not return unless the default timeout expires (*typically 300 seconds*) or all the pods are in `Running` state.


Before submitting the command below you should ensure you have enough resources in your cluster to deploy the helm chart (*see __Pre-Reqs__ section above*). If you do not have enough compute resources in your cluster to run with the default allocation, you can adjust the resource request via the command line by using the optional parameters `--resources.*.*`. See an example [*Example 3*](#example-3) in section __3.a.__ below.
Before submitting the command below you should ensure you have enough resources in your cluster to deploy the helm chart (*see __Pre-Reqs__ section above*). If you do not have enough compute resources in your cluster to run with the default allocation, you can adjust the resource request via the command line by using the optional parameters `--resources.*.*`. See an example [*Example 3*](#example-3) in section __3.b.i__ below.

All Helm parameters are described in the table at the bottom of this section.
#### 3.a) Start the Multi-Cluster-App-Dispatcher Controller on All Target Deployment Clusters (*Agent Mode*).
#### 3.b.i) Start the Multi-Cluster-App-Dispatcher Controller on All Target Deployment Clusters (*Agent Mode*).
__Agent Mode__: Install and set up the `multi-cluster-app-dispatcher` controller (_MCAD_) in *Agent Mode* for each clusters that will orchestrate the resources defined within an _AppWrapper_ using Helm. *Agent Mode* is the default mode when deploying the _MCAD_ controller.
```
helm install mcad-controller --namespace kube-system --wait --set image.repository=<image repository and name> --set image.tag=<image tag> --set imagePullSecret.name=<Name of image pull kubernetes secret> --set imagePullSecret.password=<REPLACE_WITH_REGISTRY_TOKEN_GENERATED_IN_PREREQs_STAGE1_REGISTRY.d)> --set localConfigName=<Local Kubernetes Config File for Current Cluster> --set volumes.hostPath=<Host_Path_location_of_local_Kubernetes_config_file>
helm upgrade --install --wait mcad . --namespace kube-system --wait --set image.repository=<image repository and name> --set image.tag=<image tag> --set imagePullSecret.name=<Name of image pull kubernetes secret> --set imagePullSecret.password=<REPLACE_WITH_REGISTRY_TOKEN_GENERATED_IN_PREREQs_STAGE1_REGISTRY.d)> --set localConfigName=<Local Kubernetes Config File for Current Cluster> --set volumes.hostPath=<Host_Path_location_of_local_Kubernetes_config_file>
```

##### Example 1
*Assuming the default for `image.repository` and `image.tag` fields*:
*Deploying MCAD using built images*:

```
helm install mcad-controller --namespace kube-system
helm upgrade --install --wait mcad . --namespace kube-system --set image.pullPolicy=IfNotPresent --set image.repository=darroyo/mcad-controller --set image.tag=quota-management-v1.29.40

```

##### Example 2
*Assuming the MCAD controller image is already pulled onto the local target machine with the following image `image.repository=mcad-controller`, `image.tag=latest`*
*Assuming the default for `image.repository` and `image.tag` fields*:
```
helm install mcad-controller --namespace kube-system --wait --set image.pullPolicy=Never --set image.repository=mcad-controller --set image.tag=latest
helm upgrade --install --wait mcad . --namespace kube-system
```
##### Example 3
*Assuming the MCAD controller image is already pulled onto the local target machine with the following image `image.repository=mcad-controller`, `image.tag=latest`*
```
helm upgrade --install --wait mcad . --namespace kube-system --set image.pullPolicy=Never --set image.repository=mcad-controller --set image.tag=latest
```
##### Example 4
To adjust the cpu and memory demands of the deployment with command line overrides example:

```
helm install mcad-controller --namespace kube-system --wait --set resources.requests.cpu=1000m --set resources.requests.memory=1024Mi --set resources.limits.cpu=1000m --set resources.limits.memory=1024Mi --set image.repository=myDockerReegistry/mcad-controller --set image.tag=latest --set image.pullPolicy=Always
helm upgrade --install --wait mcad . --namespace kube-system --wait --set resources.requests.cpu=1000m --set resources.requests.memory=1024Mi --set resources.limits.cpu=1000m --set resources.limits.memory=1024Mi --set image.repository=myDockerRegistry/mcad-controller --set image.tag=latest --set image.pullPolicy=Always
```

##### Example 5
MCAD supports bring-you-own scheduler use case. To install MCAD with co-scheduler use the follwing command:

```
#### 3.b) Start the Multi-Cluster-App-Dispatcher Controller on the Controller Cluster (*Dispatcher Mode*).
export IMAGE=darroyo/mcad-controller

helm upgrade --install --wait mcad . --namespace kube-system --set loglevel=4 --set image.repository=$IMAGE --set image.tag=quota-management-v1.29.40 --set image.pullPolicy=IfNotPresent --set configMap.name=mcad-controller-configmap --set configMap.quotaEnabled='"false"' --set coscheduler.rbac.apiGroup="scheduling.sigs.k8s.io" --set coscheduler.rbac.resource="podgroups"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove --set coscheduler.rbac.apiGroup="scheduling.sigs.k8s.io" --set coscheduler.rbac.resource="podgroups" as they are not needed for the general case?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the new example that was added to the documentation:

##### Example 5 MCAD supports bring-you-own scheduler use case. To install MCAD with co-scheduler use the follwing command: 
```

#### 3.b.ii) Start the Multi-Cluster-App-Dispatcher Controller on the Controller Cluster (*Dispatcher Mode*).
_Dispatcher Mode__: Install and set up the Multi-Cluster-App-Dispatcher Controler (_MCAD_) in *Dispatcher Mode* for the control cluster that will dispatch the _MCAD_ controller to an *Agent* cluster using Helm.


__Dispatcher Mode__: Installing the Multi-Cluster-App-Dispatcher Controler in *Dispatcher Mode*.
```
helm install mcad-controller --namespace kube-system --wait --set image.repository=<image repository and name> --set image.tag=<image tag> --set configMap.name=<Config> --set configMap.dispatcherMode='"true"' --set configMap.agentConfigs=agent101config:uncordon --set volumes.hostPath=<Host_Path_location_of_all_agent_Kubernetes_config_files>
helm upgrade --install --wait mcad . --namespace kube-system --wait --set image.repository=<image repository and name> --set image.tag=<image tag> --set configMap.name=<Config> --set configMap.dispatcherMode='"true"' --set configMap.agentConfigs=agent101config:uncordon --set volumes.hostPath=<Host_Path_location_of_all_agent_Kubernetes_config_files>
```

For example:
```
helm install mcad-controller --namespace kube-system --wait --set image.repository=tonghoon --set image.tag=both --set configMap.name=mcad-deployer --set configMap.dispatcherMode='"true"' --set configMap.agentConfigs=agent101config:uncordon --set volumes.hostPath=/etc/kubernetes
helm upgrade --install --wait mcad . --namespace kube-system --wait --set image.repository=tonghoon --set image.tag=both --set configMap.name=mcad-deployer --set configMap.dispatcherMode='"true"' --set configMap.agentConfigs=agent101config:uncordon --set volumes.hostPath=/etc/kubernetes
```
### Chart configuration

Expand All @@ -165,18 +187,19 @@ The following table lists the configurable parameters of the helm chart and thei
| `resources.requests.memory` | Memory Request for _MCAD_ Controller Deployment (must be less than Memory Limit) | `2048Mi` | `1024Mi` |
| `serviceAccount` | Name of service account of _MCAD_ Controller | `mcad-controller` | `my-service-account` |
| `volumes.hostPath` | Full path on the host location where the `localConfigName` file is stored | | `/etc/kubernetes` |

| `coscheduler.rbac.apiGroup` | API group to be added to create podgroups | `scheduling.sigs.k8s.io`| `scheduling.sigs.k8s.io`|
| `coscheduler.rbac.resource` | Resource allowed to be created by co-scheduler | `podgroups`| `podgroups` |

### 4. Verify the installation.
List the Helm installation. The `STATUS` should be `DEPLOYED`.
List the Helm installation using command `helm ls --all-namespaces--all` . The `STATUS` should be `DEPLOYED`.

NOTE: The `--wait` parameter in the helm installation command from [Step 3](#3-run-the-installation-using-helm) above ensures all resources are deployed and running if the `STATUS` indicates `DEPLOYED`. Installing the Helm Chart without the `--wait` parameter does not ensure all resources are successfully running but may still show a `Status` of `Deployed`.

The `STATUS` value of `FAILED` indicates all resources were not created and running before the timeout occurred. Usually this indicates a pod creation failure is due to insufficient resources to create the Multi-Cluster-App-Dispatcher Controller pod. Example instructions on how to adjust the resources requested for the Helm chart are described in the `NOTE` comment of *step #4* above.
```
$ helm list
$ helm ls --all-namespaces --all
NAME REVISION UPDATED STATUS CHART NAMESPACE
opinionated-antelope1 Mon Jan 21 00:52:39 2019 DEPLOYED mcad-controller-0.1.0 kube-system
mcad1 Mon Jan 21 00:52:39 2019 DEPLOYED mcad-controller-0.1.0 kube-system

```

Expand All @@ -193,20 +216,20 @@ Since no `appwrapper` jobs have yet to be deployed into the current cluster you

List the deployed Helm charts and identify the name of the Multi-Cluster-App-Dispatcher Controller installation.
```bash
helm list
helm ls --all-namespaces --all
```
For Example
```
$ helm list
$ helm ls --all-namespaces --all
NAME REVISION UPDATED STATUS CHART NAMESPACE
opinionated-antelope1 Mon Jan 21 00:52:39 2019 DEPLOYED mcad-controller-0.1.0 kube-system
mcad1 Mon Jan 21 00:52:39 2019 DEPLOYED mcad-controller-0.1.0 kube-system

```
Delete the Helm deployment.
```
helm delete <deployment_name>
helm delete <deployment_name> --namespace <namespace_name>
```
For example:
```bash
helm delete opinionated-antelope
helm delete mcad --namespace kube-system
```