Coder Social home page Coder Social logo

k8s-workshop-nctu's Introduction

Kubernetes Workshop on CNTUG

The purpose of this workshop series is to get you on-boarded to Kuberentes experience. We will guide you to setup a cluster using kubeadm, and through tools(kubectlใ€helm or kustomize) to deploy applications.

Requirements

Please download the minikube above URL.

Setup Cluster

First, Use minikube create the master node as following command:

$ minikube --profile k8s-m1 start

And then check the status via kubectl:

$ kubectl get no
NAME      STATUS    ROLES     AGE       VERSION
k8s-m1    Ready     master    2m        v1.11.0

$ kubectl -n kube-system get po -o wide
NAME                             READY     STATUS    RESTARTS   AGE       IP               NODE
coredns-78fcdf6894-cgwlj         1/1       Running   0          53s       10.244.0.3       k8s-m1
coredns-78fcdf6894-rwvt7         1/1       Running   0          53s       10.244.0.2       k8s-m1
etcd-k8s-m1                      1/1       Running   0          21s       192.168.99.100   k8s-m1
kube-addon-manager-k8s-m1        1/1       Running   0          23s       192.168.99.100   k8s-m1
kube-apiserver-k8s-m1            1/1       Running   0          7s        192.168.99.100   k8s-m1
kube-controller-manager-k8s-m1   1/1       Running   0          12s       192.168.99.100   k8s-m1
kube-flannel-ds-ftrv7            1/1       Running   0          51s       192.168.99.100   k8s-m1
kube-proxy-hxgfg                 1/1       Running   0          53s       192.168.99.100   k8s-m1
storage-provisioner              1/1       Running   0          51s       192.168.99.100   k8s-m1

Now, we will add new virtual machines as a Kubernetes node:

$ minikube --profile k8s-n1 start --node

# Get bootstrap token from master node
$ minikube --profile k8s-m1 ssh "sudo kubeadm token list"

# Use ssh go in virtual machine
$ minikube --profile k8s-n1 ssh 

# k8s-n1 vm
$ sudo su -
$ TOKEN=7rzqkm.1goumlnntalpxvw0
$ kubeadm join --token ${TOKEN} ${MASTER_IP}:8443 \
    --discovery-token-unsafe-skip-ca-verification \
    --ignore-preflight-errors=Swap \
    --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests

Finally, check the status via kubectl:

$ kubectl get no
NAME      STATUS    ROLES     AGE       VERSION
k8s-m1    Ready     master    6m        v1.11.0
k8s-n1    Ready     <none>    40s       v1.11.0

k8s-workshop-nctu's People

Contributors

kairen avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.