Skip to content

Kubernetes with Argo CD inside a container.

License

Notifications You must be signed in to change notification settings

nedix/k3d-argocd-container

Repository files navigation

k3d-argocd-container a.k.a. k8sage

Kubernetes with Argo CD inside a container. Can be used to test infrastructure code locally.

Usage

1. Create a named volume for Docker in Docker

docker volume create k8sage

2. Clone some example applications

git clone https://github.com/argoproj/argocd-example-apps.git applications/example/

3. Create an applications.yml configuration file

wget -q https://github.com/nedix/k3d-argocd-container/applications.yml.example -O applications.yml

4. Start the service

docker run --rm --pull always -d --name k8sage \
    -v k8sage:/mnt/docker \
    -v ${PWD}/applications:/mnt/applications \
    --mount "type=bind,source=${PWD}/applications.yml,target=/mnt/config/applications.yml" \
    -p 443:443 \
    -p 6445:6445 \
    --privileged \ # required for docker-in-docker \
    nedix/k3d-argocd

5a. Access the Argo CD GUI

5b. Access the Kubernetes API

Copy Kubernetes config to your host

docker cp k8sage:/etc/k8sage/cluster-config/kube/config.yaml ${PWD}/kubeconfig.yaml

Replace key clusters.0.cluster.certificate-authority-data

insecure-skip-tls-verify: true

Attribution