Co-Authors:
Hai Jun Xu (xuhjbj@cn.ibm.com) - Developer for Instana Synthetic PoP
Rong Zhu Shang (shangrz@cn.ibm.com)- Developer for Instana Synthetic PoP
Rui Yin (yinrui@cn.ibm.com) - Tech lead for Instana Synthetic
About Argo CD
GitOps provides the benefits of fast deployment, quick detection and application of configuration changes, easy rollback and recovery for infrastructure and cloud native applications.
Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes.
About Instana Synthetic Monitoring (OpenBeta)
Instana Synthetic Monitoring, also known as proactive monitoring, can simulate actions that an end-user takes on an application from different locations, and continuously monitors at a specific interval for performance characteristics like availability and response time. As of now, it is built on the product Instana, and provides a fully integrated solution with other Instana capabilities. It allows you to create Synthetic tests to monitor an application.
Synthetic PoP (Point of Presence) is the agent, where the synthetic tests are executed. Synthetic PoP needs to be deployed in a Kubernetes cluster.
Synthetic PoP and Argo CD
We propose a method to deploy the Instana Synthetic PoP with Argo CD for GitOps. Argo CD can be deployed on different Kubernetes platforms, such as OpenShift, and MicroK8s.
Take the following steps to deploy Argo CD in the following Kubernetes platforms:
For OpenShift:
Argo CD is provided as an operator Red Hat OpenShift GitOps on OpenShift.
Prerequisite:
You have installed and set up an OCP cluster, which will be used to create the Argo CD instance, and deploy the Instana Synthetic PoP.
To deploy Argo CD in Openshift, follow these steps:
1. Installing Red Hat OpenShift GitOps Operator:
First, sign into to the OCP web console of your cluster, and then install Red Hat OpenShift GitOps Operator from the OperatorHub.
2. After installation, click the Cluster Argo CD link from the menu.The login page of the Argo CD UI is displayed:
3. Refer to these instructions to obtain the password of your Argo CD admin account:
4. Sign in to the Argo CD, and the main dashboard of Argo CD UI is shown in the applications view:
5. Register the cluster to Argo CD instance:
You can click documentation link to download the Argo CD CLI and OCP clusters to the Argo CD instance through CLI as shown:
export USER=kubeadmin
export PASSWORD=*****
export CLUSTER_LONG_NAME=https://api.syngitop.cp.fyre.ibm.com:6443
export CLUSTER_SHORT_NAME=syngitop
oc login -u $USER -p $PASSWORD $CLUSTER_LONG_NAME --insecure-skip-tls-verify=true
CLUSTER_CONTEXT_NAME=$(kubectl config view -o jsonpath='{.current-context}')
echo $CLUSTER_CONTEXT_NAME
oc config rename-context $CLUSTER_CONTEXT_NAME $CLUSTER_SHORT_NAME --insecure-skip-tls-verify=true
export ARGOCD_SERVER=openshift-gitops-server-openshift-gitops.apps.syngitop.cp.fyre.ibm.com
export ARGOCD_USER=admin
export ARGOCD_PASSWORD=*****
export InstanaNamespace=synthetic
argocd login $ARGOCD_SERVER --username $ARGOCD_USER --password $ARGOCD_PASSWORD
argocd cluster add $CLUSTER_SHORT_NAME -y
argocd cluster list|grep $CLUSTER_SHORT_NAME
oc new-project $InstanaNamespace
Note: CLUSTER_LONG_NAME is the OCP Cluster API address, ARGOCD_SERVER is the Argo CD server address,PASSWORD & ARGOCD_PASSWORD are determined by your environments.
After running the commands, you can see that the cluster named syngitops is listed in the UI.
6. Install the Synthetic PoP with Argo CD CLI:
As the PoP supports the helm chart install method,Argo CD provides the CLI with helm parameters;you can combine both to create an Argo CD application against the Synthetic PoP helm chart. The details are as shown in the following commands:
argocd app create synthetic-pop-staging --repo https://agents.instana.io/helm \
--helm-chart synthetic-pop --revision 1.0.8 \
--dest-namespace synthetic \
--dest-server https://api.syngitop.cp.fyre.ibm.com:6443 \
--helm-set controller.instanaKey="*****" \
--helm-set controller.instanaSyntheticEndpoint="https://synsfbd1.fyre.ibm.com/synthetics" \
--helm-set controller.location="syngitop_stage;syngitop_stage;Country15;OCP;39.54;116.23;My syngitop_stage" \
--helm-set downloadKey="*****" \
--helm-set redis.tls.enabled=false \
--helm-set redis.password="123456abcd"
Note: The above parameters are the minimum parameters, which are following the Synthetic PoP install requirements.
You'll see the new application (synthetic-pop-staging) displayed with initial Missing and OutOfSync states in the Argo CD Applications dashboard.
7. Synchronize the Argo CD application:
Click the SYNC button to synchronize versions for the application "synthetic-pop-staging". A pop-up window is displayed with synchronization options. Argo CD automatically detects the differences between the desired manifests in Git and the live state in the cluster, and marks those out-of-sync resources with a Yellow icon. Make sure all OutOfSync resources are selected, and then click the SYNCHRONIZE button.
After a while, all Kubernetes resources are created and the application is shown as Healthy and Synced. The Instana Synthetic PoP is deployed successfully.
8. Upgrade the application:
If there is a new Synthetic PoP Helm chart version that is published, then you can directly upgrade the revision version from SYNCHRONIZE in the UI to deploy the latest Synthetic PoP.
To deploy Argo CD in Microk8s, follow the steps as shown:
For Microk8s:
Prerequisite:
microk8s enable dns && microk8s stop && microk8s start
1. Register a cluster to the Argo CD instance to deploy the PoP by following the steps:
I. Install the Argo CD using the following command:
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml2.2.2 Download Argo CD CLI:
curl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
sudo install -m 555 argocd-linux-amd64 /usr/local/bin/argocd
rm argocd-linux-amd64
II. Download the Argo CD CLI by using the following commands:
kubectl patch svc argocd-server -n argocd -p '{"spec":{"type": "LoadBalancer"}}'
III. To access the Argo CD API Server, use the following command:
kubectl patch svc argocd-server -n argocd -p '{"spec":{"type": "LoadBalancer"}}'
V. Export API server by using the following command:
kubectl port-forward svc/argocd-server -n argocd 8080:443
IV. Sign in to the Argo CD server by using the following commands:
argocd admin initial-password -n argocd
argocd login localhost:8080
VI. Add a cluster instance using the following commands:
kubectl config get-contexts -o name
argocd cluster add microk8s
VII. You can create apps using CLI and the following commands:
kubectl config set-context --current --namespace=argocd
argocd app create synthetic-pop --repo https://agents.instana.io/helm \
--helm-chart synthetic-pop --revision 1.0.8 \
--dest-namespace default \
--dest-server https://kubernetes.default.svc \
--helm-set controller.instanaKey="****" \
--helm-set controller.instanaSyntheticEndpoint="https://synsfbd1.fyre.ibm.com/synthetics" \
--helm-set controller.location="syngitop_p1;syngitop_p1;Country15;OCP;39.54;116.23;My syngitop_stage" \
--helm-set downloadKey="*****" \
--helm-set redis.tls.enabled=false \
--helm-set redis.password="123456abcd"
2. Check the application status in the UI. You can see the new application detail status displayed in the Argo CD application dashboard.
Conclusion:
We can leverage GitOps to help in the deployment and management of Synthetic PoP, thereby improving the operation tasks in an efficient way.