From 7bc18afeef20a5d4e54991f2a4cb2c8b5d7e7d5b Mon Sep 17 00:00:00 2001 From: Felixnoo Date: Thu, 22 Apr 2021 16:37:19 +0800 Subject: [PATCH] wording updated Signed-off-by: Felixnoo --- content/en/blogs/argo-cd-a-tool-for-devops.md | 58 ++++++++++--------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/content/en/blogs/argo-cd-a-tool-for-devops.md b/content/en/blogs/argo-cd-a-tool-for-devops.md index 95da82b89..d44e756d5 100644 --- a/content/en/blogs/argo-cd-a-tool-for-devops.md +++ b/content/en/blogs/argo-cd-a-tool-for-devops.md @@ -4,11 +4,11 @@ keywords: Kubernetes, KubeSphere, DevOps, Argo CD, GitOps description: A Quick Introduction about Argo CD. tag: 'Kubernetes, KubeSphere, DevOps, Argo CD, GitOps' createTime: '2021-04-16' -author: 'Shaowen Chen, Felix' +author: 'Shaowen Chen, Felix, Sherlock' snapshot: '/images/blogs/en/argo-cd-a-tool-for-devops/argo-schematics.png' --- -In this post, I'll show you how Argo CD betters Kubernetes DevOps process. Before we begin practicing, let's look at some background information first. +In this post, I'll show you how Argo CD betters Kubernetes DevOps process. Before we begin, let's look at some background information. ## Argo CD Capability @@ -16,13 +16,13 @@ In this post, I'll show you how Argo CD betters Kubernetes DevOps process. Befor As you may already know, Weaveworks published a post titled [GitOps - Operations by Pull Request](https://www.weave.works/blog/gitops-operations-by-pull-request) in 2017. Alexis, the author, introduced a way of deployment by using Git as source of truth. -In GitOps practices, we need to define and manage software infrastructures in Git repositories. Software infrastructures involve not only infrastructures like IaaS and Kubernetes but also applications. Everyone can make modifications to software infrastructures by submitting a Pull Request, and an automated program will perform those modifications. +In GitOps practices, we need to define and manage software infrastructures in Git repositories. Software infrastructures involve not only IaaS and Kubernetes but also applications. Everyone can make modifications to software infrastructures by submitting a Pull Request, and an automated program will perform those modifications. Thus, everyone will be able to focus on developing new features instead of worrying about operation and maintenance including installation, modification, and migration. ### Argo CD: GitOps coming true -Argo CD is a GitOps continuous delivery (CD) tool on top of Kubernetes. Here is the schematic diagram from Argo CD community. +Argo CD is a GitOps continuous delivery (CD) tool on top of Kubernetes. Here is the schematic diagram from the Argo CD community. ![argo-schematics](/images/blogs/en/argo-cd-a-tool-for-devops/argo-schematics.png) @@ -30,7 +30,7 @@ You can see from the diagram that: 1. Argo CD pulls application configurations from Git Repo and deploys applications in Kubernetes clusters. 2. If someone wants to add a new feature, he or she just needs to submit a Pull Request to Git Repo to modify application deployment configurations. Then, wait for merging. -3. Once the Pull Request gets merged, Argo CD will run updating per Webhook triggers. +3. Once the Pull Request gets merged, Argo CD will run an update per Webhook triggers. 4. Applications updated and notifications sent. To sum it up, automated operation and maintenance and continuous delivery. Simple and easy to understand, right? @@ -43,15 +43,17 @@ The above functions will be able to cover ordinary Kubernetes operation and main Argo CD defines four components in its processing logic: -- Event Source: integrate various event messages. -- Sensor: switch messages to triggering actions. -- Eventbus: message subscription routing system. -- Trigger: trigger external actions. +- [Event Source](https://argoproj.github.io/argo-events/concepts/event_source/): An `EventSource` defines the configurations required to consume events from external sources. +- [Sensor](https://argoproj.github.io/argo-events/concepts/sensor/): It listens to events on the eventbus and acts as an event dependency manager to resolve and execute the triggers. +- [Eventbus](https://argoproj.github.io/argo-events/concepts/eventbus/): It acts as the transport layer of Argo-Events by connecting the event-sources and sensors. +- [Trigger](https://argoproj.github.io/argo-events/concepts/trigger/): A Trigger is the resource/workload executed by the sensor once the event dependencies are resolved. + +For more information, see [Architecture](https://argoproj.github.io/argo-events/concepts/architecture/). As for operation and maintenance folks, you just need to focus on two aspects: -- Events Argo CD can process: AMQP, AWS SNS, AWS SQS, Cron Schedules, GCP PubSub, GitHub, GitLab, HDFS, File Based Events, Kafka, Minio, NATS, MQTT, K8s Resources, Slack, NetApp StorageGrid, Webhooks, Stripe, NSQ, Emitter, Redis, Azure Events Hub. -- Actions Argo CD can perform: Argo Workflows, Standard K8s Objects, HTTP Requests, AWS Lambda, NATS Messages, Kafka Messages, Slack Notifications, Argo Rollouts CR, Custom/Build Your Own Triggers, Apache OpenWhisk. +- Events Argo CD can process: AMQP, AWS SNS, AWS SQS, Cron Schedules, GCP PubSub, GitHub, GitLab, HDFS, File Based Events, Kafka, Minio, NATS, MQTT, K8s Resources, Slack, NetApp StorageGrid, Webhooks, Stripe, NSQ, Emitter, Redis, and Azure Events Hub. +- Actions Argo CD can perform: Argo Workflows, Standard K8s Objects, HTTP Requests, AWS Lambda, NATS Messages, Kafka Messages, Slack Notifications, Argo Rollouts CR, Custom/Build Your Own Triggers, and Apache OpenWhisk. ## Argo CD on Kubernetes @@ -73,7 +75,7 @@ I'll use Kubernetes v1.18.3 to deploy Argo CD. {{< notice note >}} - Argo CD community also provides an HA deployment method by running the command `kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/v1.8.3/manifests/ha/install.yaml`. It's for deployment in production environment. + The Argo CD community also provides an HA deployment method by running the command `kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/v1.8.3/manifests/ha/install.yaml`. It's for deployment in production. {{}} @@ -83,10 +85,10 @@ I'll use Kubernetes v1.18.3 to deploy Argo CD. kubectl patch svc argocd-server -p '{"spec": {"type": "NodePort"}}' -n argocd ``` -4. Run the following command to view all the Services in the namespace argocd. +4. Run the following command to view all the Services in the namespace `argocd`. ```bash - kubectl -n argocd get svc + $ kubectl -n argocd get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE argocd-dex-server ClusterIP 10.233.34.191 5556/TCP,5557/TCP,5558/TCP 5m37s @@ -102,14 +104,14 @@ I'll use Kubernetes v1.18.3 to deploy Argo CD. 1. Run the following command to get the admin account's password. ```bash - kubectl get pod -n argocd |grep argocd-server + $ kubectl get pod -n argocd |grep argocd-server - argocd-server-7d597d9bcd-6nzct 1/1 Running 0 22m + argocd-server-7d597d9bcd-6nzct 1/1 Running 0 22m ``` - The Pod ID is the password, namely, argocd-server-7d597d9bcd-6nzct. + The Pod ID is the password, namely, `argocd-server-7d597d9bcd-6nzct`. -2. Access Argo CD Web page through http://{HOST_IP}:31808, and use `admin/argocd-server-7d597d9bcd-6nzct` as account and password to log in. +2. Access Argo CD Web page through `http://{HOST_IP}:31808`, and use `admin/argocd-server-7d597d9bcd-6nzct` as account and password to log in. ![argocd-page](/images/blogs/en/argo-cd-a-tool-for-devops/argocd-page.png) @@ -117,19 +119,19 @@ I'll use Kubernetes v1.18.3 to deploy Argo CD. ### Step 3: Install CLI tool -Let's use Linux machine as an example. +Let's use Linux as an example. -1. Run the following commands to download CLI command line tool and make it executable. +1. Run the following commands to download CLI tool and make it executable. ```bash curl -sSL -o /usr/local/bin/argocd https://github.com/argoproj/argo-cd/releases/download/v1.8.3/argocd-linux-amd64 chmod +x /usr/local/bin/argocd ``` -2. Run the following command to use the CLI tool to log in to the Argo CD running on Kubernetes cluster. Make sure you replace `HOST_IP` with your host IP address. +2. Run the following command to use the CLI tool to log in to the Argo CD running on your Kubernetes cluster. Make sure you replace `HOST_IP` with your host IP address. ```bash - argocd login {HOST_IP}:31808 --username admin --password argocd-server-7d597d9bcd-6nzct + $ argocd login {HOST_IP}:31808 --username admin --password argocd-server-7d597d9bcd-6nzct 'admin' logged in successfully Context '{HOST_IP}:31808' updated @@ -138,7 +140,7 @@ Let's use Linux machine as an example. 3. You can use the following command to update the admin password to `password` for your convenience. ```bash - argocd account update-password --account admin --current-password argocd-server-7d597d9bcd-6nzct --new-password password + $ argocd account update-password --account admin --current-password argocd-server-7d597d9bcd-6nzct --new-password password Password updated Context '{HOST_IP}:31808' updated @@ -156,10 +158,10 @@ We surely can create an application through the Web UI, but let's use the CLI to As for the flags in the command: - - --repo: specify the Git repository. - - --path: specify the relative path of the deployment files in the Git repository. - - --dest-server: address for accessing the cluster. - - --dest-namespace: namespace for deploying the application. + - `--repo`: specify the Git repository. + - `--path`: specify the relative path of the deployment files in the Git repository. + - `--dest-server`: address for accessing the cluster. + - `--dest-namespace`: namespace for deploying the application. If you go to the directory `https://github.com/argoproj/argocd-example-apps/tree/master/guestbook`, you can find two YAML files for Deployment and Service respectively. @@ -174,7 +176,7 @@ We surely can create an application through the Web UI, but let's use the CLI to 4. Run the following command to see the Services created. ```bash - kubectl get all -n default + $ kubectl get all -n default NAME READY STATUS RESTARTS AGE pod/guestbook-ui-65b878495d-wjmxh 1/1 Running 0 60s