Move GETTING_STARTED.md to docs directory and link to it from README.md

This commit is contained in:
Jesse Suen 2018-03-08 16:05:16 -08:00
parent 9d890761a7
commit 3e47c4ca71
No known key found for this signature in database
GPG key ID: 90C911E8A6106562
4 changed files with 96 additions and 85 deletions

View file

@ -10,12 +10,18 @@ Argo CD is a declarative, continuous delivery service based on ksonnet for Kuber
Application definitions, configurations, and environments should be declarative and version controlled.
Application deployment and lifecycle management should be automated, auditable, and easy to understand.
## Getting Started
Follow our [getting started guide](docs/GETTING_STARTED.md).
## How it works
Argo CD uses git repositories as the source of truth for defining the desired application state as
well as the target deployment environments. Kubernetes manifests are specified as
[ksonnet](https://ksonnet.io) applications and implements automated services to deploy and maintain
the desired application states in the specified target environments.
[ksonnet](https://ksonnet.io) applications. Argo CD automates the deployment of the desired
application states in the specified target environments.
![Argo CD Architecture](docs/argocd_architecture.png)
Argo CD is implemented as a kubernetes controller which continuously monitors running applications
and compares the current, live state against the desired target state (as specified in the git repo).
@ -25,8 +31,6 @@ manually sync the live state back to the desired target state. Any modifications
target state in the git repo can be automatically applied and reflected in the specified target
environments.
![Argo CD Architecture](docs/argocd_architecture.png)
For additional details, see [architecture overview](docs/ARCHITECTURE.md).
## Features
@ -51,19 +55,19 @@ both re-use and granular customization of application and environment specificat
Application configuration management is a hard problem and grows rapidly in complexity as you deploy
more applications, against more and more environments. Current templating systems, such as Jinja,
and Golang templating, are unnatural ways to maintain kubernetes manifests, and are not well suited to
capture subtle configuration differences between environments. The ability to compose and re-use
application and environment configurations is also limited.
capture subtle configuration differences between environments. Its ability to compose and re-use
application and environment configurations is also very limited.
Imagine we have a single guestbook application deployed in following environments:
| Environment | K8s Version | Application Image | DB Connection String | Environment Vars | Sidecars |
|--------------------|-------------|------------------------|-----------------------|------------------|---------------|
| minikube | 1.10.0 | jesse/guestbook:latest | sql://locahost/db | DEBUG=true | |
| dev | 1.9.0 | app/guestbook:latest | sql://dev-test/db | DEBUG=true | |
| staging | 1.8.0 | app/guestbook:e3c0263 | sql://staging/db | | istio,dnsmasq |
| prod-us-west-1 | 1.8.0 | app/guestbook:abc1234 | sql://prod/db | FOO_FEATURE=true | istio,dnsmasq |
| prod-us-west-2 | 1.8.0 | app/guestbook:abc1234 | sql://prod/db | | istio,dnsmasq |
| prod-us-east-1 | 1.9.0 | app/guestbook:abc1234 | sql://prod/db | BAR_FEATURE=true | istio,dnsmasq |
| Environment | K8s Version | Application Image | DB Connection String | Environment Vars | Sidecars |
|---------------|-------------|------------------------|-----------------------|------------------|---------------|
| minikube | 1.10.0 | jesse/guestbook:latest | sql://locahost/db | DEBUG=true | |
| dev | 1.9.0 | app/guestbook:latest | sql://dev-test/db | DEBUG=true | |
| staging | 1.8.0 | app/guestbook:e3c0263 | sql://staging/db | | istio,dnsmasq |
| us-west-1 | 1.8.0 | app/guestbook:abc1234 | sql://prod/db | FOO_FEATURE=true | istio,dnsmasq |
| us-west-2 | 1.8.0 | app/guestbook:abc1234 | sql://prod/db | | istio,dnsmasq |
| us-east-1 | 1.9.0 | app/guestbook:abc1234 | sql://prod/db | BAR_FEATURE=true | istio,dnsmasq |
Ksonnet:
* Enables composition and re-use of common YAML specifications

78
docs/GETTING_STARTED.md Normal file
View file

@ -0,0 +1,78 @@
# Argo CD Getting Started
An example Ksonnet guestbook application is provided to demonstrates how Argo CD works.
## Requirements
* Installed [minikube](https://github.com/kubernetes/minikube#installation)
* Installed the [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) command-line tool
* Have a [kubeconfig](https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/) file (default location is `~/.kube/config`).
## 1. Download Argo CD
Download the latest Argo CD version from the [releases](https://github.com/argoproj/argo-cd/releases) page.
## 2. Install the Argo CD components
```
$ argocd install
```
This will create a new namespace, `argocd`, where Argo CD services and application resources will live.
## 3. Open access to Argo CD API server
By default, the Argo CD API server is not exposed with an external IP. To expose the API server,
change service type to `LoadBalancer`:
```
$ kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'
```
Export API server URL into `ARGOCD_SERVER` environment variable, which the CLI looks to for
connection information:
```
$ export ARGOCD_SERVER=$(minikube service argocd-server -n argocd --url | cut -d'/' -f 3)
```
Now, Argo CD is able to talk to API server and you can deploy your first application.
## 4. Connect and deploy the Guestbook application
1. Register the minikube cluster to Argo CD:
```
$ argocd cluster add minikube
```
The `argocd cluster add CONTEXT` command installs an `argocd-manager` ServiceAccount and ClusterRole into
the cluster associated with the supplied kubectl context. Argo CD then uses the associated service account
token to perform its required management tasks (i.e. deploy/monitoring).
2. Add the guestbook application and github repository containing the Guestbook application
```
$ argocd repo add https://github.com/argoproj/argo-cd.git
$ argocd app add guestbook --repo https://github.com/argoproj/argo-cd.git --path examples/guestbook --env minikube
```
Once the application is added, you can now see its status:
```
$ argocd app list
$ argocd app sync guestbook
```
The application status is initially in an `OutOfSync` state, since the application has yet to be
deployed, and no Kubernetes resouces have been created. To sync (deploy) the application, run:
```
$ argocd app sync guestbook
```
[![asciicast](https://asciinema.org/a/uYnbFMy5WI2rc9S49oEAyGLb0.png)](https://asciinema.org/a/uYnbFMy5WI2rc9S49oEAyGLb0)
Argo CD also allows to view and manager applications using web UI. Get the web UI URL by running:
```
$ minikube service argocd-server -n argocd --url
```
![argo cd ui](argocd-ui.png)

View file

Before

Width:  |  Height:  |  Size: 109 KiB

After

Width:  |  Height:  |  Size: 109 KiB

View file

@ -1,71 +0,0 @@
# Argo CD Getting Started
Guestbook app demonstrates how ArgoCD works, you can run examples of simple workflows and workflows that use artifacts.
## Requirements
* Installed [minikube](https://github.com/kubernetes/minikube#installation)
* Installed the [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) command-line tool
* Have a [kubeconfig](https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/) file (default location is `~/.kube/config`).
## 1. Download Argo CD
`TO BE ADDED`
## 2. Install the Argo CD components
```
$ argocd install
```
## 3. Open access to Argo CD API server and configure Argo CD CLI
By default Argo CD API server is not exposed with an external IP. To expose API server, change service type to `LoadBalancer` use the following command:
```
$ kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'
```
Export API server URL into `ARGOCD_SERVER` environment variable using the following command":
```
$ export ARGOCD_SERVER=$(minikube service argocd-server -n argocd --url | cut -d'/' -f 3)
```
Now you Argo CD is able to talk to API server and you can deploy first application.
## 4. Connect and deploy Guestbook application
1. Register minicube cluster and github repository which contains Guestbook application:
```
$ argocd repo add https://github.com/argoproj/argo-cd.git
$ argocd cluster add minikube
```
2. Add Guestbook application:
```
$ argocd app add guestbook --repo https://github.com/argoproj/argo-cd.git --path examples/guestbook --env minikube
```
Once application is added you can see application status using following commands:
```
$ argocd app list
$ argocd app sync guestbook
```
The application status is `OutOfSync` and not Kubernetes resouces have been created since application is not deployed yet. To deploy application use following command:
```
$ argocd app sync guestbook
```
[![asciicast](https://asciinema.org/a/uYnbFMy5WI2rc9S49oEAyGLb0.png)](https://asciinema.org/a/uYnbFMy5WI2rc9S49oEAyGLb0)
Argo CD allows to view and manager applications using web UI. Get the web UI URL using following command:
```
minikube service argocd-server -n argocd --url
```
![argo cd ui](argocd-ui.png)