- Minikube & Argo on your local machine
$ brew cask install minikube $ brew install hyperkit $ minikube config set vm-driver hyperkit $ brew tap argoproj/tap $ brew install argoproj/tap/argocd
- Setup the argo application
- Setup & run your argo application
$ ./start-minikube.sh $ ./init-argo.sh
- The argo server is now running, now it's time to run your application
- Open a new Terminal:
$ ./apply-argo-app.sh
- Open a new Terminal:
- View your Argo app in the browser
- Get the admin password
$ ./argo/get-argo-password.sh argocd-server-xxxxxxxxx-xxxxx
- Go to https://localhost:8080/ username: admin password: argocd-server-xxxxxxxxx-xxxxx
- Change the express server code
- Bump the package.json file
docker/webserver/package.json
- Bump the Docker image version
./.env
./k8s/example-app/base/deployment.yaml
- Update the docker/k8s manifest
$ cd scripts
$ ./build.sh
- Push code to github to view the changes
- Make sure you have a cluster ready if not run:
$ ./start-minikube.sh
- Build the docker image on the cluster's docker engine
- You want to have this image built before running k8s cause this specific image is not on dockerhub
$ cd docker $ ./build-local-image.sh
- Build and run the k8s files
$ cd k8s $ ./run-local.sh
-
Setup your cluster
$ minikube start --kubernetes-version v1.15.7 -p argo $ eval $(minikube docker-env -p argo) $ kubectl config get-contexts
-
Install Argo CD
$ kubectl create namespace argocd $ kubectl apply -n argocd -f argo/install.yaml
- this will create 2 new resources "CustomResourceDefinition" project & application
$ kubectl create clusterrolebinding YOURNAME-cluster-admin-binding --clusterrole=cluster-admin [email protected]
- Build local docker image with the k8s docker engine
- You want to make sure you build the docker image inside the cluster so it will have access to it
$ eval $(minikube docker-env -p argo) $ cd ./docker $ ./build-local-image.sh $ docker images
-
Test your k8s application locally
$ cd ./k8s $ kubectl create namespace testing-k8s $ ./run-local.sh $ minikube service test-node-express-api --namespace=testing-k8s -p argo $ kubectl delete namespace testing-k8s
-
Run the Argo CD server locally
- By default, the Argo CD API server is not exposed with an external IP.
- To access the API server, choose one of the following techniques to expose the Argo CD API server:
(1) Port Forwarding
- Kubectl port-forwarding can also be used to connect to the API server without exposing the service.
$ kubectl port-forward svc/argocd-server -n argocd 8080:443
- The API server can then be accessed using the localhost:8080
- Kubectl port-forwarding can also be used to connect to the API server without exposing the service.
- Login Using The CLI
- The initial password is autogenerated to be the pod name of the Argo CD API server. Get the password with the command: $ kubectl get pods -n argocd -l app.kubernetes.io/name=argocd-server -o name | cut -d'/' -f 2 argocd-server-xxxxxxxxx-xxxxx
- go to https://localhost:8080/ username: admin password: argocd-server-xxxxxxxxx-xxxxx
- Create an Application
- Get the admin password
$ ./argo/get-argo-password.sh argocd-server-xxxxxxxxx-xxxxx
- Go to https://localhost:8080/ username: admin password: argocd-server-xxxxxxxxx-xxxxx
- Run an Argo app
$ cd argo $ kubectl apply -n argocd -f argo.yaml
- Access your cluster
$ minikube service test-node-express-api --namespace=argocd -p argo