From 9ad2bd2368c0d236382f43482c6842fe222aab73 Mon Sep 17 00:00:00 2001 From: Jaideep Rao Date: Wed, 10 Aug 2022 15:20:09 -0400 Subject: [PATCH] update user guide for managing machinesets with openshift gitops Signed-off-by: Jaideep Rao --- docs/OpenShift GitOps Usage Guide.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/OpenShift GitOps Usage Guide.md b/docs/OpenShift GitOps Usage Guide.md index e5e99eb03..3b7aaa8ec 100644 --- a/docs/OpenShift GitOps Usage Guide.md +++ b/docs/OpenShift GitOps Usage Guide.md @@ -1310,6 +1310,32 @@ metadata: Note - Any manually added nodeSelectors and tolerations in the default Argo CD CR will be overwritten by the toggle and tolerations in gitops service CR.![image alt text](assets/31.operator_nodeSelector_tolerations.jpg) + +## Managing MachineSets with OpenShift GitOps + +Machinesets are resources that are created during an OpenShift cluster's installation and can be used to manipulate compute units or "machines" on said OpenShift cluster. They typically contain cluster specific information such as availability zones that are hard to predict, and randomly generated names that cannot be known beforehand. As such, machinesets are hard targets to manage in a GitOps way. However, users wanting to manage their machinests using Argo CD can still do so, with a little manual effort, by leveraging server-side apply. + +Users can manually find out the resource names for the machinesets available on their clusters by running the command: +`oc get machinesets -n openshift-machine-api` + +Users can then create a patch for this resouce by only expressing the name of the target machineset and the specific set of fields and values that they would like to modify and manage through Argo CD. For example: + +``` +apiVersion: machine.openshift.io/v1beta1 +kind: MachineSet +metadata: + name: rhoms-4-10-081004-6jgmc-worker-us-east-2a +spec: + replicas: 3 + +``` + +Users can store the above described patch within their GitOps repositories to be applied and managed along with other Argo CD managed resources. + +[Kubernetes Server Side Apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/) allows users to patch existing resources and manage specific sets of fields only by setting the 'field manager' for those fields appropriately. Argo CD will soon include the ability to support server-side apply for manifests as described in this [accepted proposal](https://github.com/argoproj/argo-cd/blob/master/docs/proposals/server-side-apply.md#server-side-apply-support-for-argocd). Users will have the option to express that they would like to enforce server-side apply through a new sync option either at application level, or at individual resource level by leveraging appropriate annotations (more details [here](https://github.com/argoproj/argo-cd/blob/master/docs/proposals/server-side-apply.md#use-cases)). + +On following these steps, users should be able to manage their machinesets using Argo CD v2.5 and upwards (available with OpenShift GitOps v1.7 and upwards). They should be able to have Argo CD apply their patches to existing resources using server-side apply, see the changes reflected on cluster, and have the 'field manager' updated appropriately for their resources. + ## Monitoring OpenShift GitOps automatically detects Argo CD instances on the cluster and wires them up with the cluster monitoring stack with one alert installed out-of-the-box for reporting out-of-sync apps. No additional configuration is required.