ArgoCD with Kind
This post will document how to run an ArgoCD instance locally, using Kind to create the Kubernetes cluster. In addition, I will use cert-manager to create a self-signed certificate to serve it with HTTPS.
Creating the cluster with kind
First of all, is to have a Kubernetes cluster. You will require to have kind
available in your path (maybe downloading to your ~/bin
or ~/.local/bin
makes the trick). This is the configuration file I used:
# kind.yaml kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane kubeadmConfigPatches: - | kind: InitConfiguration nodeRegistration: kubeletExtraArgs: node-labels: "ingress-ready=true" extraPortMappings: - containerPort: 80 hostPort: 80 protocol: TCP - containerPort: 443 hostPort: 443 protocol: TCP
So, to create the cluster just type:
$ kind create cluster --config=kind.yaml
Wait until full process ends and... you got it!
Add ingress to your cluster
In order to add ingress to the kind cluster, it's required to add an ingress controller.
Here you have what I did to install the nginx controller:
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml
It requires a couple of minutes to download images and... Done!
Cert manager
Well... let's do things almost in the right way by using self-signed certificates. This will be easier than it seems to be :)
To install cert-manager, just run:
$ kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v1.0.2/cert-manager.yaml
Now it will require a issuer. I needed to create this file:
# cert-issuer.yaml apiVersion: cert-manager.io/v1 kind: ClusterIssuer metadata: name: test-selfsigned spec: selfSigned: {}
And run next command:
$ kubectl apply -f cert-issuer.yaml
That's it.
ArgoCD
Now it's time to install ArgoCD:
$ kubectl create namespace argocd $ kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
Local link
I will serve it at argocd.local. So I need to modify my /etc/hosts
to have
this line:
127.0.0.1 localhost argocd.local
Ingress
Once we have the URL, it's required to have an ingress. So I needed the file:
# ingress.yaml apiVersion: extensions/v1beta1 kind: Ingress metadata: name: argocd-server-ingress namespace: argocd annotations: kubernetes.io/ingress.class: nginx cert-manager.io/cluster-issuer: test-selfsigned nginx.ingress.kubernetes.io/force-ssl-redirect: "true" nginx.ingress.kubernetes.io/ssl-passthrough: "true" nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" spec: rules: - http: paths: - backend: serviceName: argocd-server servicePort: https host: argocd.local tls: - secretName: https-cert hosts: - argocd.local
And run it:
$ kubectl apply -f ingress.yaml
And it will be ready!
Access
Just open https://argocd.local to enter. The username is admin and the password is the name of the argo server docker, which can be obtained with:
$ kubectl get pods -n argocd -l app.kubernetes.io/name=argocd-server -o name | cut -d'/' -f 2
Comments
Comments powered by Disqus