Skip to content

Commit

Permalink
add kind launch file
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Cook <[email protected]>
  • Loading branch information
cooktheryan committed Dec 20, 2023
1 parent e92d5be commit a7ac971
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions hack/kind.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# spin up kind cluster
cat <<EOF | kind create cluster --image kindest/node:v1.28.0 --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraMounts:
- containerPath: /var/lib/kubelet/config.json
hostPath: "${HOME}/.docker/config.json"
EOF

kind get kubeconfig > /tmp/config
chown $USER:$USER /tmp/config
if [[ -d ~/.kube ]] && [[ -f ~/.kube/config ]]
then
export KUBECONFIG=~/.kube/config:/tmp/config
oc config view --flatten > merged-config.yaml
mv merged-config.yaml ~/.kube/config
else
mv /tmp/config ~/.kube/config
fi
chmod go-r ~/.kube/config

oc config use-context kind-kind

0 comments on commit a7ac971

Please sign in to comment.