-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tidy up for the example configuration of k8s
- Loading branch information
Showing
15 changed files
with
85 additions
and
47 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,15 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: special-config | ||
namespace: default | ||
data: | ||
special.how: very | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: env-config | ||
namespace: default | ||
data: | ||
log_level: INFO |
File renamed without changes.
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 |
---|---|---|
@@ -1,18 +1,21 @@ | ||
apiVersion: extensions/v1beta1 | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx0-deployment | ||
name: nginx-deployment | ||
labels: | ||
app: nginx0-deployment | ||
app: nginx | ||
spec: | ||
replicas: 2 | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx0 | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: k8s.gcr.io/nginx:1.7.9 | ||
image: nginx:1.7.9 | ||
ports: | ||
- containerPort: 80 |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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,9 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
namespace: default | ||
name: pod-reader | ||
rules: | ||
- apiGroups: [""] # "" indicates the core API group | ||
resources: ["pods"] | ||
verbs: ["get", "watch", "list"] |
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,52 @@ | ||
#!/bin/bash | ||
|
||
sudo swapoff -a | ||
|
||
# install docker | ||
sudo apt-get remove docker docker-engine docker.io containerd runc | ||
sudo apt-get update | ||
sudo apt-get install \ | ||
apt-transport-https \ | ||
ca-certificates \ | ||
curl \ | ||
gnupg-agent \ | ||
software-properties-common | ||
|
||
|
||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | ||
sudo apt-key fingerprint 0EBFCD88 | ||
|
||
# on arm | ||
sudo add-apt-repository \ | ||
"deb [arch=arm64] https://download.docker.com/linux/ubuntu \ | ||
$(lsb_release -cs) \ | ||
stable" | ||
sudo apt-get update | ||
sudo apt-get install docker-ce docker-ce-cli containerd.io | ||
# do a sanity check | ||
sudo docker run hello-world | ||
|
||
# install kubeadm/kubectl | ||
apt-get update && apt-get install -y apt-transport-https curl | ||
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - | ||
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list | ||
deb https://apt.kubernetes.io/ kubernetes-xenial main | ||
EOF | ||
apt-get update | ||
apt-get install -y kubelet kubeadm kubectl | ||
apt-mark hold kubelet kubeadm kubectl | ||
|
||
# setup cluster with kubeadm | ||
|
||
# replace "10.169.40.58" with your host IP | ||
kubeadm init --apiserver-advertise-address 10.169.40.58 --pod-network-cidr=10.244.0.0/16 | ||
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/62e44c867a2846fefb68bd5f178daf4da3095ccb/Documentation/kube-flannel.yml | ||
|
||
# make it work for non-root user, might need to remove the cofig file | ||
mkdir -p $HOME/.kube | ||
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config | ||
sudo chown $(id -u):$(id -g) $HOME/.kube/config | ||
|
||
|
||
# join other nodes | ||
#kubeadm join xxx --token xxx --discovery-token-ca-cert-hash xxx |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.