From 9012e9518d524d0d382618789a9f48d44854eca9 Mon Sep 17 00:00:00 2001 From: Elamaran Shanmugam Date: Tue, 23 Apr 2024 17:09:30 -0400 Subject: [PATCH 1/6] Dev Containers --- .devcontainer/devcontainer.json | 17 +++++++++++++++++ .devcontainer/postCreateCommand.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100755 .devcontainer/postCreateCommand.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..0a491e11 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,17 @@ +{ + "image": "mcr.microsoft.com/vscode/devcontainers/base:ubuntu", + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": {}, + "ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {}, + "ghcr.io/devcontainers/features/aws-cli:1": {} + }, + "postCreateCommand": ".devcontainer/postCreateCommand.sh", + "workspaceFolder": "/home/vscode/conformitron", + "workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/conformitron,type=bind", + "hostRequirements": { + "cpus": 2 + }, + "remoteEnv": { + "PATH": "${containerEnv:PATH}:/home/vscode/conformitron" + } +} \ No newline at end of file diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh new file mode 100755 index 00000000..c46f7604 --- /dev/null +++ b/.devcontainer/postCreateCommand.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# Step 1 setup autocomplete for kubectl and alias k +mkdir $HOME/.kube +echo "source <(kubectl completion bash)" >> $HOME/.bashrc +echo "alias k=kubectl" >> $HOME/.bashrc +echo "complete -F __start_kubectl k" >> $HOME/.bashrc + +# Step 2 - Installs Flux on your local machine. +echo "----------------------------------------------------" +echo "Downloading 'Flux' ..." +curl -O "https://toolkit.Fluxcd.io/install.sh" --silent --location +echo "Installing 'Flux' ..." +chmod +x ./install.sh +./install.sh +rm -rf ./install.sh + +# Step 3 Setup Minikube +minikube start +minikube addons enable ingress +# Run this to forward to localhost in the background +nohup kubectl port-forward --pod-running-timeout=24h -n ingress-nginx service/ingress-nginx-controller :80 & + +# Step 4 - Installs Flux Controller on your Kubernetes Cluster. +flux install \ + --namespace=flux-system \ + --network-policy=false \ + --components=source-controller,helm-controller,kustomize-controller,notification-controller \ No newline at end of file From 66ef8ed7e31e9d62494dd03279e25e04bd74a6e9 Mon Sep 17 00:00:00 2001 From: Elamaran Shanmugam Date: Tue, 23 Apr 2024 17:16:47 -0400 Subject: [PATCH 2/6] Dev Containers --- .devcontainer/postCreateCommand.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index c46f7604..0420d84c 100755 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -17,9 +17,6 @@ rm -rf ./install.sh # Step 3 Setup Minikube minikube start -minikube addons enable ingress -# Run this to forward to localhost in the background -nohup kubectl port-forward --pod-running-timeout=24h -n ingress-nginx service/ingress-nginx-controller :80 & # Step 4 - Installs Flux Controller on your Kubernetes Cluster. flux install \ From 7c02d724cc616003dcba62a77875dd62ab665fb6 Mon Sep 17 00:00:00 2001 From: Elamaran Shanmugam Date: Tue, 23 Apr 2024 17:43:43 -0400 Subject: [PATCH 3/6] Dev Containers --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 0a491e11..0acc631c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,7 +9,7 @@ "workspaceFolder": "/home/vscode/conformitron", "workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/conformitron,type=bind", "hostRequirements": { - "cpus": 2 + "cpus": 4 }, "remoteEnv": { "PATH": "${containerEnv:PATH}:/home/vscode/conformitron" From 2daac58f50f96f986874686792929a70eec0d750 Mon Sep 17 00:00:00 2001 From: Elamaran Shanmugam Date: Tue, 23 Apr 2024 17:48:47 -0400 Subject: [PATCH 4/6] Dev Containers --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f96b01f9..d4802eff 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,8 @@ Refer the example [here](https://github.com/aws-samples/eks-anywhere-addons/blob ## Pre-requisite (Linux/MacOS) +Please use the dev container configuration in the `.devcontainer` folder with [devpod](devpod.sh) or any other dev container environment to create minikube cluster with all required pre-requisites such helm, kubectl and flux for local testing. You can skip over to local testing section if you use dev container environment. + This solution requires Flux CLI locally and Flux Controller on your Kubernetes cluster. Flux requires access to a source repository via api and access to the kubernetes cluster you want to use for testing. Please follow the below steps for installing these pre-requisites. If you do not already have access to a running kubernetes cluster you can consider setting up an [EKS Anywhere local cluster](https://anywhere.eks.amazonaws.com/docs/getting-started/local-environment/) on docker provider or a local [k3s](https://k3s.io/) cluster or you may choose a hosted service such as [AWS EKS](https://aws.amazon.com/eks/). From dcb0738b99df1e65d5a58c22dae9224c09b86419 Mon Sep 17 00:00:00 2001 From: "Elamaran (Ela) Shanmugam" <51791117+elamaran11@users.noreply.github.com> Date: Thu, 2 May 2024 14:49:20 -0400 Subject: [PATCH 5/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d4802eff..62ef9f82 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Refer the example [here](https://github.com/aws-samples/eks-anywhere-addons/blob ## Pre-requisite (Linux/MacOS) -Please use the dev container configuration in the `.devcontainer` folder with [devpod](devpod.sh) or any other dev container environment to create minikube cluster with all required pre-requisites such helm, kubectl and flux for local testing. You can skip over to local testing section if you use dev container environment. +Please use the dev container configuration in the `.devcontainer` folder with [devpod](devpod.sh) or any other dev container environment to create minikube cluster with all the required pre-requisites such helm, kubectl and flux for local testing. You can skip over to the local testing section if you use dev container environment. This solution requires Flux CLI locally and Flux Controller on your Kubernetes cluster. Flux requires access to a source repository via api and access to the kubernetes cluster you want to use for testing. Please follow the below steps for installing these pre-requisites. From e0cf924489bbd223d127a03236a63ae4c56ef169 Mon Sep 17 00:00:00 2001 From: "Elamaran (Ela) Shanmugam" <51791117+elamaran11@users.noreply.github.com> Date: Thu, 2 May 2024 14:50:06 -0400 Subject: [PATCH 6/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 62ef9f82..1d722358 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Refer the example [here](https://github.com/aws-samples/eks-anywhere-addons/blob ## Pre-requisite (Linux/MacOS) -Please use the dev container configuration in the `.devcontainer` folder with [devpod](devpod.sh) or any other dev container environment to create minikube cluster with all the required pre-requisites such helm, kubectl and flux for local testing. You can skip over to the local testing section if you use dev container environment. +Please use the dev container configuration in the `.devcontainer` folder with [devpod](devpod.sh) or any other dev container environment to create minikube cluster with all the required pre-requisites such as helm, kubectl and flux for local testing. You can skip over to the local testing section if you use dev container environment. This solution requires Flux CLI locally and Flux Controller on your Kubernetes cluster. Flux requires access to a source repository via api and access to the kubernetes cluster you want to use for testing. Please follow the below steps for installing these pre-requisites.