Skip to content

Instantly share code, notes, and snippets.

@testpilot031
Created August 12, 2020 08:31
Show Gist options
  • Save testpilot031/5f9e933852c40a5cebeefe3ae5a07041 to your computer and use it in GitHub Desktop.
Save testpilot031/5f9e933852c40a5cebeefe3ae5a07041 to your computer and use it in GitHub Desktop.

make file web server app

cat << EOL > server.js var http = require('http');

var handleRequest = function(request, response) { console.log('Received request for URL: ' + request.url); response.writeHead(200); response.end('Hello World!'); }; var www = http.createServer(handleRequest); www.listen(8080); EOL

make docker image

cat << EOL > Dockerfile FROM node:6.14.2 EXPOSE 8080 COPY server.js . CMD node server.js EOL docker build -t kube-node:test .

1. Initializes cluster master node:

kubeadm init --apiserver-advertise-address $(hostname -i) --pod-network-cidr 10.5.0.0/16

other pod join

kubeadm join 192.168.0.8:6443 --token eylctm.8221ikowtq11cvlk
--discovery-token-ca-cert-hash sha256:fb010ba3fea14aafc278c06738818a915ef98206fd40015ec53222334fb5c9f2

2. Initialize cluster networking:

kubectl apply -f https://raw.githubusercontent.com/cloudnativelabs/kube-router/master/daemonset/kubeadm-kuberouter.yaml

3. (Optional) Create an nginx deployment:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/application/nginx-app.yaml

kubectl create deployment kubetest --image=kube-node:test kubectl describe pod kubectl get services kubectl expose deployment/kubetest --type="LoadBalancer" --port 8080

podがpending のまま

kubectl get nodes kubectl taint nodes node1 node-role.kubernetes.io/master:NoSchedule-

kubeadm config images pull

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment