forked from kubernetes/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
abbed4f
commit ce90b83
Showing
9 changed files
with
185 additions
and
7 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
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
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,43 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2015 The Kubernetes Authors All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This script is intended to set up the files necessary to run a master. | ||
# It currently creates: | ||
# * The basic auth file for access to the kubernetes api server | ||
# * Service tokens for accessing the kubernetes api server | ||
# * The CA cert and keys for HTTPS access to the kubernetes api server | ||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
create_token() { | ||
echo $(cat /dev/urandom | base64 | tr -d "=+/" | dd bs=32 count=1 2> /dev/null) | ||
} | ||
|
||
# Create basic token authorization | ||
echo "admin,admin,admin" > /data/basic_auth.csv | ||
|
||
# Create HTTPS certificates | ||
CERT_DIR=/data /make-ca-cert.sh $(hostname -i) | ||
|
||
# Create known tokens for service accounts | ||
echo "$(create_token),admin,admin" >> /data/known_tokens.csv | ||
echo "$(create_token),kubelet,kubelet" >> /data/known_tokens.csv | ||
echo "$(create_token),kube_proxy,kube_proxy" >> /data/known_tokens.csv | ||
|
||
while true; do | ||
sleep 3600 | ||
done |
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 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2015 The Kubernetes Authors All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Tears down an existing cluster. Warning destroys _all_ docker containers on the machine | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
echo "Warning, this will delete all Docker containers on this machine." | ||
echo "Proceed? [Y/n]" | ||
|
||
read resp | ||
if [[ $resp == "n" || $resp == "N" ]]; then | ||
exit 0 | ||
fi | ||
|
||
docker ps -aq | xargs docker rm -f |
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,50 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2015 The Kubernetes Authors All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Useful for testing images and changes, turns up a fresh single node cluster | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
docker run --net=host -d gcr.io/google_containers/etcd:2.2.1 \ | ||
/usr/local/bin/etcd \ | ||
--addr=127.0.0.1:4001 \ | ||
--bind-addr=0.0.0.0:4001 \ | ||
--data-dir=/var/etcd/data | ||
|
||
docker run --pid=host \ | ||
--volume=/:/rootfs:ro \ | ||
--volume=/sys:/sys:ro \ | ||
--volume=/dev:/dev \ | ||
--volume=/var/lib/docker/:/var/lib/docker:rw \ | ||
--volume=/var/lib/kubelet/:/var/lib/kubelet:rw \ | ||
--volume=/var/run:/var/run:rw \ | ||
--net=host \ | ||
--pid=host \ | ||
--privileged=true \ | ||
-d gcr.io/google_containers/hyperkube:v${K8S_VERSION} \ | ||
/hyperkube kubelet \ | ||
--containerized \ | ||
--hostname-override="127.0.0.1" \ | ||
--address="0.0.0.0" \ | ||
--api-servers=http://localhost:8080 \ | ||
--config=/etc/kubernetes/manifests --v=10 | ||
|
||
docker run -d --net=host --privileged \ | ||
gcr.io/google_containers/hyperkube:v${K8S_VERSION} \ | ||
/hyperkube proxy \ | ||
--master=http://127.0.0.1:8080 --v=2 |
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