you can use Kind, Minikube, or k3s. but here we can use Kind as kubernetes environment
https://github.com/launathiel/kubernetes-lightweight/blob/main/kind/kind.md
source: https://metallb.universe.tf/installation/
kubectl edit configmap -n kube-system kube-proxy
and set
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
mode: "ipvs"
ipvs:
strictARP: true #if false, set to true
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.11.0/manifests/namespace.yaml
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.11.0/manifests/metallb.yaml
apiVersion: v1
kind: ConfigMap
metadata:
namespace: metallb-system
name: config
data:
config: |
address-pools:
- name: default
protocol: layer2
addresses:
- 172.18.0.40-172.18.0.50
you can check addresses from any range on your kubernetes node IP network
for example,
kubectl get node -o wide
Here, you get 172.18.0.2
. so you can use 172.18.0.40-172.18.0.50
as addresses range
kubectl apply -f https://raw.githubusercontent.com/adaptivenetlab/Kubernetes/main/template/deployment/deployment.yaml
kubectl apply -f https://raw.githubusercontent.com/adaptivenetlab/Kubernetes/main/template/service/loadbalancer.yaml
kubectl get svc
if you get external IP and you can access the service, it means that your metallb loadbalancer has sucessfully deployed!
kubectl delete -f https://raw.githubusercontent.com/adaptivenetlab/Kubernetes/main/template/deployment/deployment.yaml
kubectl delete -f https://raw.githubusercontent.com/adaptivenetlab/Kubernetes/main/template/service/loadbalancer.yaml
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
kubectl create ns ingress-nginx
helm install myingress ingress-nginx/ingress-nginx -n ingress-nginx
helm list -n ingress-nginx
kubectl get all -n igress-nginx
note that External-IP
curl -L https://istio.io/downloadIstio | sh -
cd istio-1.9.2
export PATH=$PWD/bin:$PATH
istioctl operator init
kubectl get all -n istio-operator
kubectl create ns istio-system
kubectl apply -f - <<EOF
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
namespace: istio-system
name: example-istiocontrolplane
spec:
profile: demo
EOF
kubectl get all -n istio-system
kubectl create ns postsapp
kubectl label ns postsapp istio-injection=enabled
kubectl apply -f MongoDB/mongodb-secrets.yaml -n postsapp
kubectl apply -f MongoDB/MongoDB-posts/mongodb-pv.yaml -n postsapp
kubectl apply -f MongoDB/MongoDB-posts/mongodb-pvc.yaml -n postsapp
kubectl apply -f MongoDB/MongoDB-posts/mongodb-deployment.yaml -n postsapp
kubectl apply -f MongoDB/MongoDB-posts/mongodb-clusterip.yaml -n postsapp
kubectl apply -f MongoDB/MongoDB-comments/mongodb-pv.yaml -n postsapp
kubectl apply -f MongoDB/MongoDB-comments/mongodb-pvc.yaml -n postsapp
kubectl apply -f MongoDB/MongoDB-comments/mongodb-deployment.yaml -n postsapp
kubectl apply -f MongoDB/MongoDB-comments/mongodb-clusterip.yaml -n postsapp
kubectl apply -f infra/k8s/posts-depl.yaml -n postsapp
kubectl apply -f infra/k8s/comments-depl.yaml -n postsapp
kubectl apply -f infra/k8s/client-depl.yaml -n postsapp
kubectl apply -f ingress-srv.yaml -n postsapp
sudo vi /etc/hosts
172.18.0.43 posts.com
ssh -ND 9090 user@192.168.0.20
using socks5://127.0.0.1:9090
chrome.exe --proxy-server="socks5://localhost:9090"
kubectl apply -f https://gitlab.com/gilangvperdana/microservices-app-on-k-8-s-with-istio/-/raw/master/addons/prometheus.yaml -n istio-system
kubectl apply -f https://gitlab.com/gilangvperdana/microservices-app-on-k-8-s-with-istio/-/raw/master/addons/grafana.yaml -n istio-system
Change Service Grafana to LoadBalancer:
kubectl edit svc grafana -n istio-system
access http://<ip-external-service-grafana>:3000
kubectl apply -f https://gitlab.com/adaptivenetlab/adaptive-network-laboratory-kubernetes-service-mesh-untuk-aplikasi-microservices/-/raw/master/addons/kiali-crd.yaml -n istio-system
kubectl apply -f https://gitlab.com/adaptivenetlab/adaptive-network-laboratory-kubernetes-service-mesh-untuk-aplikasi-microservices/-/raw/master/addons/kiali.yaml -n istio-system
Change service to LoadBalancer:
kubectl edit svc kiali -n istio-system
kubectl get svc kiali -n istio-system
access http://ip_external_kiali:20001
Happy Exploring!
for detail, click here
kubectl apply -f infra/istio/gateway.yaml
kubectl apply -f infra/istio/destination-rule.yaml
kubectl apply -f infra/istio/virtual-service.yaml