Skip to content

kulmam92/k3s-argocd-bootstrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

k3s-argocd-bootstrap

Bootstrapping K3S/K8S using ArgoCD. Inspired by the postings in the references section.

Prerequisites

  • K3D: k3d is a lightweight wrapper to run k3s (Rancher Lab’s minimal Kubernetes distribution) in docker.
  • kubectl: The kubectl command line tool lets you control Kubernetes clusters.
  • kustomize: Kustomize introduces a template-free way to customize application configuration that simplifies the use of off-the-shelf applications.
  • K9S CLI: K9s is a terminal based UI to interact with your Kubernetes clusters.
  • xip.io: xip.io is a magic domain name that provides wildcard DNS. You don't need to install anything for this.

Follow

└── K3D ──> MetalLB ──> Deploy ArgoCD using Kustomize
                        ├──> Deploy ArgoCD
                        └──> Deploy ArgoCD APP - bootstrap-cluster Helm chart
                             ├──> Deploy namespace.yaml
                             ├──> Deploy ArgoCD APP - ingress-nginx-app Helm chart
                             ├──> Deploy ArgoCD APP - cert-manager-app Helm chart
                             │    ├──> Deploy cert-manager
                             │    └──> Create letsencrypt cluster issuer
                             ├──> Deploy ArgoCD APP - k8s-config-app Helm chart
                             ├──> Deploy ArgoCD APP - argocd-ingress-app Helm chart
                             └──> Deploy ArgoCD APP - kube-prometheus-stack-app Helm chart

How to Run

Configure K3S

  1. Provision K3S cluster
make provision-dev-cluster
  1. Install metallb
make install-metallb
  1. Configure tuntap

Mac only

make configure-tuntap

The script is from K3s with k3d and MetalLB. Refer to this article for more details.

  1. argocd-bootstrap Run one more time if it fails with the below error.

error: unable to recognize "STDIN": no matches for kind "Application" in version "argoproj.io/v1alpha1"

make argocd-bootstrap

The kustomize script for ArgoCD and folder structure is from Bootstrap a kubernetes cluster with ArgoCD and Istio.

  1. Monitor using K9S
k9s

ArgoCD

  1. Set a temporary argocd password
make set-argocd-password
  1. Check Ingress
❯ kubectl -n argocd get ingress

NAME                    CLASS    HOSTS   ADDRESS      PORTS   AGE
argocd-server-ingress   <none>   *       172.18.0.3   80      158m
  1. Log into argocd UI Open web browser and type /argo-cd
172.18.0.3/argo-cd

Prometheus

  1. Check Ingress

I registered both 172.18.0.3 and 172.18.0.4 since external IP of ingress-nginx-controller is one of them most of the time.

❯ kubectl -n monitoring get ingress

NAME                                 CLASS    HOSTS                                                           ADDRESS      PORTS   AGE
kube-prometheus-stack-alertmanager   <none>   alertmanager.172.18.0.3.xip.io,alertmanager.172.18.0.4.xip.io   172.18.0.3   80      37m
kube-prometheus-stack-grafana        <none>   grafana.172.18.0.3.xip.io,grafana.172.18.0.4.xip.io             172.18.0.3   80      37m
kube-prometheus-stack-prometheus     <none>   prometheus.172.18.0.3.xip.io,prometheus.172.18.0.4.xip.io       172.18.0.3   80      105s
  1. Log into UI Open web browser and type
  • alertmanager.172.18.0.3.xip.io
  • grafana.172.18.0.3.xip.io
  • prometheus.172.18.0.3.xip.io

How to cleanup

make cleanup

References

About

bootstrapping K3S/K8S using ArgoCD

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published