Skip to main content

Posts

Showing posts from November 5, 2019

Nginx Ingress controller setup in K8S MultiNode Cluster with HA-Proxy as External LB

https://github.com/nginxinc/kubernetes-ingress/blob/master/docs/installation.md Pre-requisites: ############### >> K8s cluster setup with 1 Master and 2 Worker nodes. >> Deployed an application with Deployment name "client-sb" >> Also you need to create an HA-proxy server by spinning an Ec2 instance. After login the Ha-proxy server. # yum install haproxy # vi /etc/haproxy/haproxy.cfg delete everything after the global and defaults starting from "Main front-end which proxys to the backend" paste the below code in the end of the file: --------------------- frontend http_front   bind *:80   stats uri /haproxy?stats   default_backend http_back backend http_back   balance roundrobin   server kube 10.0.1.14:80   server kube 10.0.1.12:80 --------------------- # systemctl status haproxy # systemctl enable haproxy # systemctl start haproxy 1. Create a Namespace, a SA, the Default Secret, the Customization Config Map, an

Persistent Volume in K8s Multinode cluster with NFS

nfs - server (10.0.1.9) ############ Amazon machine linux # yum update # yum install nfs-utils -y # systemctl enable nfs-server # systemctl start nfs-server # mkdir -p /srv/nfs/k8sdata # chmod -R 777 /srv/nfs/k8sdata # vi /etc/exports /srv/nfs/k8sdata *(rw,no_subtree_check,no_root_squash,insecure) :wq! # exportfs -rav # exportfs -v /srv/nfs/k8sdata (rw,sync,wdelay,hide,no_subtree_check,sec=sys,insecure,no_root_squash,no_all_squash) Now in NFS- Client: ################# Ubuntu 16.04 # sudo apt-get update # sudo apt-get install nfs-common # showmount -e 10.0.1.9 Export list for 10.0.1.9: /srv/nfs/k8sdata * Testing ------- # sudo mount -t nfs 10.0.1.9:/srv/nfs/k8sdata /mnt # root@dn1:~# df -h | grep nfs 10.0.1.9:/srv/nfs/k8sdata  8.0G  1.8G  6.3G  22% /mnt # umount /mnt Now in the kubectl terminal issue the pv and pvc create with yamls cat > 4-pv-nfs.yaml apiVersion: v1 kind: PersistentVolume metadata:   name: pv-nfs-pv1   labels: