-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
53 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
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,17 @@ | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
networking: | ||
apiServerAddress: "0.0.0.0" | ||
# Ensure stable port so we can rewrite the server address later | ||
apiServerPort: 6443 | ||
|
||
# Adding this so containers from the same docker network can access it | ||
# https://blog.scottlowe.org/2019/07/30/adding-a-name-to-kubernetes-api-server-certificate/ | ||
nodes: | ||
- role: control-plane | ||
kubeadmConfigPatches: | ||
- | | ||
kind: ClusterConfiguration | ||
apiServer: | ||
certSANs: | ||
- "docker" |
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,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This scripts creates a kind cluster and verify it works | ||
|
||
set -xe | ||
|
||
# Install kind | ||
wget https://github.com/kubernetes-sigs/kind/releases/download/v0.11.1/kind-linux-amd64 | ||
chmod +x kind-linux-amd64 | ||
mv ./kind-linux-amd64 /usr/bin/kind | ||
kind --help | ||
|
||
# Install kubectl | ||
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" | ||
chmod +x kubectl | ||
mv ./kubectl /usr/bin/kubectl | ||
kubectl version --client | ||
|
||
# Create the cluster | ||
time kind create cluster --wait 120s --config ./ci/travis/kind.config.yaml | ||
docker ps | ||
|
||
# Now the kind node is running, it exposes port 6443 in the dind-daemon network. | ||
kubectl config set clusters.kind-kind.server https://docker:6443 | ||
|
||
# Verify the kubectl works | ||
kubectl version | ||
kubectl cluster-info | ||
kubectl get nodes | ||
kubectl get pods --all-namespaces | ||
|