Accéder au cluster k8s depuis l'extérieur
Rédigé par dada / 09 novembre 2018 / Aucun commentaire
Ingress Nginx
Installation via Helm
helm install stable/nginx-ingress --name my-nginx
dada@k8smaster:~$ kubectget pods -n default
NAME READY STATUS RESTARTS AGE
my-nginx-nginx-ingress-controller-565bc9555b-pcqjz 1/1 Running 2 8h
my-nginx-nginx-ingress-default-backend-5bcb65f5f4-728tx 1/1 Running 2 8h
dada@k8smaster:~$ kubectl --namespace default get services -o wide -w my-nginx-nginx-ingress-controller
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
my-nginx-nginx-ingress-controller LoadBalancer 10.100.45.147 <pending> 80:32462/TCP,443:30337/TCP 8s app=nginx-ingress,component=controller,release=my-nginx
MetalLB
Installer MetalLB
helm install --name metallb stable/metallb
dada@k8smaster:~$ kubectl get pods -n metallb-system
NAME READY STATUS RESTARTS AGE
controller-765899887-ck6bv 1/1 Running 2 8h
speaker-jdqg9 1/1 Running 2 8h
speaker-t4vtk 1/1 Running 2 8h
apiVersion: v1
kind: ConfigMap
metadata:
namespace: default
name: config
data:
config: |
address-pools:
- name: default
protocol: layer2
addresses:
- 192.168.0.50-192.168.0.60
kubectl create -f config.yaml
Retour à l'Ingress Nginx
dada@k8smaster:~/$ kubectl --namespace default get services -o wide -w my-nginx-nginx-ingress-controller
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
my-nginx-nginx-ingress-controller LoadBalancer 10.100.45.147 192.168.0.50 80:32462/TCP,443:30337/TCP 3d3h app=nginx-ingress,component=controller,release=my-nginx