Skip to content

Instantly share code, notes, and snippets.

View mhiro2's full-sized avatar
😇

Masaaki Hirotsu mhiro2

😇
View GitHub Profile
@mhiro2
mhiro2 / Vagrantfile
Last active January 2, 2021 18:45
CentOS k8s cluster with vagrant-libvirt
# -*- mode: ruby -*-
# vi: set ft=ruby :
$master_cpus = 2
$master_memory = 2048
$num_workers = 3
$worker_cpus = 4
$worker_memory = 4096
$common_script = <<-SCRIPT
$ kubectl get node -o wide
NAME STATUS ROLES AGE VERSION EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
k8s-master Ready master 10h v1.10.4 <none> CentOS Linux 7 (Core) 3.10.0-862.2.3.el7.x86_64 docker://18.3.1
k8s-node1 Ready <none> 10h v1.10.4 <none> CentOS Linux 7 (Core) 3.10.0-862.2.3.el7.x86_64 docker://18.3.1
k8s-node2 Ready <none> 10h v1.10.4 <none> CentOS Linux 7 (Core) 3.10.0-862.2.3.el7.x86_64 docker://18.3.1
k8s-node3 Ready <none> 10h v1.10.4 <none> CentOS Linux 7 (Core) 3.10.0-862.2.3.el7.x86_64 docker://18.3.1
$ curl -L https://git.io/getLatestIstio | sh
$ cd istio-0.8.0/
$ export PATH=$PWD/bin:$PATH
$ istioctl version
Version: 0.8.0
GitRevision: 6f9f420f0c7119ff4fa6a1966a6f6d89b1b4db84
User: root@48d5ddfd72da
Hub: docker.io/istio
GolangVersion: go1.10.1
BuildStatus: Clean
$ kubectl apply -f install/kubernetes/istio-demo-auth.yaml
$ kubectl get svc -n istio-system
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
grafana ClusterIP 10.97.211.13 <none> 3000/TCP 20m
istio-citadel ClusterIP 10.98.247.194 <none> 8060/TCP,9093/TCP 20m
istio-egressgateway ClusterIP 10.103.51.137 <none> 80/TCP,443/TCP 20m
istio-ingressgateway LoadBalancer 10.106.68.101 <pending> 80:31380/TCP,443:31390/TCP,31400:31400/TCP 20m
istio-pilot ClusterIP 10.103.242.192 <none> 15003/TCP,15005/TCP,15007/TCP,15010/TCP,15011/TCP,8080/TCP,9093/TCP 20m
istio-policy ClusterIP 10.106.46.201 <none> 9091/TCP,15004/TCP,9093/TCP
$ kubectl get pod -n istio-system
NAME READY STATUS RESTARTS AGE
grafana-6f6dff9986-4xzf6 1/1 Running 0 21m
istio-citadel-7bdc7775c7-vrsn9 1/1 Running 0 21m
istio-cleanup-old-ca-t7c8t 0/1 Completed 0 21m
istio-egressgateway-78dd788b6d-btl28 1/1 Running 0 21m
istio-ingressgateway-7dd84b68d6-28wnk 1/1 Running 0 21m
istio-mixer-post-install-pwfxc 0/1 Completed 0 21m
istio-pilot-d5bbc5c59-lqrbh 2/2 Running 0 21m
istio-policy-64595c6fff-g6gq5 2/2 Running 0 21m
$ kubectl apply -f samples/bookinfo/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
$ kubectl create -f <(istioctl kube-inject -f <your-app-spec>.yaml)
$ kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
details ClusterIP 10.104.79.246 <none> 9080/TCP 2m
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 27m
productpage ClusterIP 10.106.59.32 <none> 9080/TCP 2m
ratings ClusterIP 10.99.114.7 <none> 9080/TCP 2m
reviews ClusterIP 10.97.235.62 <none> 9080/TCP 2m
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
details-v1-7b97668445-7jjjl 2/2 Running 0 3m
productpage-v1-7bbdd59459-b2v9j 2/2 Running 0 3m
ratings-v1-76dc7f6b9-h97jb 2/2 Running 0 3m
reviews-v1-64545d97b4-xbzq9 2/2 Running 0 3m
reviews-v2-8cb9489c6-zr54t 2/2 Running 0 3m
reviews-v3-6bc884b456-jfzsg 2/2 Running 0 3m