diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9104be6..5fac96c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,7 +6,8 @@ }, "ghcr.io/mpriscella/features/kind:1": { "version": "latest" - } + }, + "ghcr.io/devcontainers-contrib/features/kubectl-asdf:2": {} }, "postCreateCommand": "bash -i ./.devcontainer/setup.sh", "customizations": { diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh index 958635e..0c79ba1 100644 --- a/.devcontainer/setup.sh +++ b/.devcontainer/setup.sh @@ -7,4 +7,6 @@ complete -F __start_kubectl k export PATH=~/.kubectx:$PATH alias kx=kubectx alias kns=kubens -EOF \ No newline at end of file +EOF + +mkdir ~/.kube \ No newline at end of file diff --git a/README.md b/README.md index 7a158d4..615d3c6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,31 @@ # Kyverno Demo -## Setting up the demo with the devcontainer +## Setup + +### devcontainer This demo shows how to use Kyverno to enforce policies on Kubernetes resources. You can use the devcontainer following this repo. The devcontainer has all the tools installed to run the demo. -## Setting up the demo without the devcontainer +### Setting up the demo without the devcontainer First, you will need to have _kind_ installed. You can find instructions on how to install _kind_ [here](https://kind.sigs.k8s.io/docs/user/quick-start/). + +## Running the demo + +### Create a cluster +To create a cluster, run the following command: + +```bash +kind create cluster --name kyverno-demo +``` + +### Get the kubeconfig + +```bash +kind get kubeconfig --name kyverno-demo > ~/.kube/config +``` + +### Install Kyverno +To install Kyverno, run the following command: + +```bash +kubectl apply -f https://raw.githubusercontent.com/kyverno/kyverno/main/definitions/release/install.yaml +``` \ No newline at end of file