You can now join any number of machines by running the following on each node
as root:
kubeadm join 172.24.0.3:6443 --token i67sjb.0nvjxbldwuh342of --discovery-token-ca-cert-hash sha256:aa23e1e7a4d55d06fbdf34fa2a1c703dd7e7cfff735b0b0fe800b4335aff68b5
$kubectl create serviceaccount tiller --namespace kube-system
$cat<<EOF | kubectl create -f -
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: tiller-clusterrolebinding
subjects:
- kind: ServiceAccount
name: tiller
namespace: kube-system
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: ""
EOF$helm init --service-account tiller
Creating /root/.helm
Creating /root/.helm/repository
Creating /root/.helm/repository/cache
Creating /root/.helm/repository/local
Creating /root/.helm/plugins
Creating /root/.helm/starters
Creating /root/.helm/cache/archive
Creating /root/.helm/repository/repositories.yaml
Adding stable repo with URL: https://kubernetes-charts.storage.googleapis.com
Adding local repo with URL: http://127.0.0.1:8879/charts
HELM_HOME has been configured at /root/.helm.
Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster.
Please note: by default, Tiller is deployed with an insecure 'allow unauthenticated users' policy.
For more information on securing your installation see: https://docs.helm.sh/using_helm/#securing-your-helm-installation
Happy Helming!
完後成後可透過kubectl指令確認
1
2
3
4
5
6
$kubectl get pod,svc -l app=helm -n kube-system
NAME READY STATUS RESTARTS AGE
pod/tiller-deploy-759cb9df9-b7n7j 1/1 Running 0 4m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/tiller-deploy ClusterIP 10.107.71.110 <none> 44134/TCP 4m
$kubectl apply -f <(istioctl kube-inject -f samples/bookinfo/platform/kube/bookinfo.yaml)
service/details created
deployment.extensions/details-v1 created
service/ratings created
deployment.extensions/ratings-v1 created
service/reviews created
deployment.extensions/reviews-v1 created
deployment.extensions/reviews-v2 created
deployment.extensions/reviews-v3 created
service/productpage created
deployment.extensions/productpage-v1 created
透過kubectl指令確認安裝的pod及service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$kubectl get pod
NAME READY STATUS RESTARTS AGE
details-v1-fc9649d9c-tqbcn 2/2 Running 0 1m
productpage-v1-58845c779c-2lqxg 2/2 Running 0 27m
ratings-v1-6cc485c997-zqvqt 2/2 Running 0 1m
reviews-v1-76987687b7-hfrn2 2/2 Running 0 1m
reviews-v2-86749dcd5-ffmvs 2/2 Running 0 1m
reviews-v3-7f4746b959-zr4ml 2/2 Running 0 1m
$kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
details ClusterIP 10.101.208.129 <none> 9080/TCP 1m
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 27m
productpage ClusterIP 10.101.11.13 <none> 9080/TCP 1m
ratings ClusterIP 10.105.132.197 <none> 9080/TCP 1m
reviews ClusterIP 10.103.199.76 <none> 9080/TCP 1m
$kubectl apply -f samples/bookinfo/networking/virtual-service-all-v1.yaml
virtualservice.networking.istio.io/productpage created
virtualservice.networking.istio.io/reviews created
virtualservice.networking.istio.io/ratings created
virtualservice.networking.istio.io/details created