Merge pull request #287 from dims/use-latest-localkube

Test with latest localkube version
This commit is contained in:
Mehdy Bohlool 2017-07-07 11:35:01 -07:00 committed by GitHub
commit f6d80b06cf
2 changed files with 35 additions and 4 deletions

View File

@ -49,8 +49,6 @@ class WSClient:
if url.startswith('wss://') and configuration.verify_ssl:
ssl_opts = {
'cert_reqs': ssl.CERT_REQUIRED,
'keyfile': configuration.key_file,
'certfile': configuration.cert_file,
'ca_certs': configuration.ssl_ca_cert or certifi.where(),
}
if configuration.assert_hostname is not None:
@ -58,6 +56,11 @@ class WSClient:
else:
ssl_opts = {'cert_reqs': ssl.CERT_NONE}
if configuration.cert_file:
ssl_opts['certfile'] = configuration.cert_file
if configuration.key_file:
ssl_opts['keyfile'] = configuration.key_file
self.sock = WebSocket(sslopt=ssl_opts, skip_utf8_validation=False)
self.sock.connect(url, header=header)
self._connected = True

View File

@ -55,7 +55,7 @@ sudo chmod +x kubectl
sudo mv kubectl /usr/local/bin/
echo "Download localkube from minikube project"
wget -O localkube "https://storage.googleapis.com/minikube/k8sReleases/v1.6.0-alpha.0/localkube-linux-amd64"
wget -O localkube "https://storage.googleapis.com/minikube/k8sReleases/v1.7.0/localkube-linux-amd64"
sudo chmod +x localkube
sudo mv localkube /usr/local/bin/
@ -63,11 +63,39 @@ echo "Starting localkube"
sudo nohup localkube --logtostderr=true --enable-dns=false > localkube.log 2>&1 &
echo "Waiting for localkube to start..."
if ! timeout 120 sh -c "while ! curl -ks https://127.0.0.1:8443/ >/dev/null; do sleep 1; done"; then
if ! timeout 120 sh -c "while ! curl -ks http://127.0.0.1:8080/ >/dev/null; do sleep 1; done"; then
sudo cat localkube.log
die $LINENO "localkube did not start"
fi
echo "Check certificate permissions"
sudo chmod 644 /var/lib/localkube/certs/*
sudo ls -altr /var/lib/localkube/certs/
echo "Set up .kube/config"
mkdir ~/.kube
cat <<EOF > ~/.kube/config
apiVersion: v1
clusters:
- cluster:
insecure-skip-tls-verify: true
server: https://localhost:8443
name: local
contexts:
- context:
cluster: local
user: myself
name: local
current-context: local
kind: Config
preferences: {}
users:
- name: myself
user:
client-certificate: /var/lib/localkube/certs/apiserver.crt
client-key: /var/lib/localkube/certs/apiserver.key
EOF
echo "Dump Kubernetes Objects..."
kubectl get componentstatuses
kubectl get configmaps