-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ryan Cook <[email protected]>
- Loading branch information
1 parent
e92d5be
commit a7ac971
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |