Skip to content

Commit

Permalink
Merge pull request #35 from enp0s3/fix-deploy-script
Browse files Browse the repository at this point in the history
deploy: add some inprovements
  • Loading branch information
fabiand authored Jun 20, 2024
2 parents 7b052f3 + 74729de commit 9fa3dc5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
25 changes: 15 additions & 10 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ SWAP usage is supported on worker nodes only.
> swap usage for containers on the node level.
> The low-level nature requires the `DaemonSet` to be privileged.
> [!NOTE]
> For Red Hat release please replace the container image URL in the example with the following:
> ```console
> registry.redhat.io/container-native-virtualization/wasp-agent-rhel9:latest
> ```
1. Create a privileged service account:
```console
Expand All @@ -45,22 +51,21 @@ $ oc adm policy add-cluster-role-to-user cluster-admin -n wasp -z wasp
$ oc adm policy add-scc-to-user -n wasp privileged -z wasp
```
2. Deploy `wasp-agent`
2. Deploy `wasp-agent`.
Create a `DaemonSet` according to the following
[example](../manifests/ds.yaml).

3. Configure `Kubelet` to permit swap
Create a `KubeletConfiguration` according to the following
[example](../manifests/kubelet-configuration-with-swap.yaml).

> [!NOTE]
> For Red Hat release please replace the container image URL in the example with the following:
> ```console
> registry.rdhat.io/container-native-virtualization/wasp-agent-rhel9:latest
> ```
4. Wait for the worker nodes to finish syncing before proceeding to the next step.
you can use the following command:
```console
$ oc wait mcp worker --for condition=Updated=True
```

4. Create `MachineConfig` to provision swap according to the following [example](../manifests/machineconfig-add-swap.yaml)
5. Create `MachineConfig` to provision swap according to the following [example](../manifests/machineconfig-add-swap.yaml)

> [!CAUTION]
> All worker nodes in a cluster are expected to have the same
Expand All @@ -85,10 +90,10 @@ $ oc adm policy add-scc-to-user -n wasp privileged -z wasp
> = 16 GB * (0.5)
> = 8 GB
5. Deploy alerting rules according to the following
6. Deploy alerting rules according to the following
[example](../manifests/prometheus-rules.yaml).

6. Configure OpenShift Virtualization to use memory overcommit using
7. Configure OpenShift Virtualization to use memory overcommit using

a. the OpenShift Console
b. the following [HCO example](../manifests/hco-set-memory-overcommit.yaml):
Expand Down
3 changes: 2 additions & 1 deletion to.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ qoc() { oc $@ > /dev/null 2>&1; }
apply() {
_oc apply -f manifests/ds.yaml
_oc apply -f manifests/kubelet-configuration-with-swap.yaml
wait_for_mcp
_oc apply -f manifests/machineconfig-add-swap.yaml
_oc apply -f manifests/prometheus-rules.yaml
qoc get namespace openshift-cnv && _oc patch --type=merge -f manifests/hco-set-memory-overcommit.yaml --patch-file manifests/hco-set-memory-overcommit.yaml || i "No CNV, No HCO patch"
Expand All @@ -30,7 +31,7 @@ deploy() {
_oc project $NS
qoc get sa -n $NS $SA || {
_oc create sa -n $NS $SA
_oc adm policy add-cluster-role-to-user cluster-admin -z $SA
_oc adm policy add-cluster-role-to-user cluster-admin -n $NS -z $SA
_oc adm policy add-scc-to-user -n $NS privileged -z $SA
}
apply
Expand Down

0 comments on commit 9fa3dc5

Please sign in to comment.