• Home
  • Hosting
  • Tech
  • Server
  • Security
Mex Linux
  • Home
  • Hosting
  • Tech
  • Server
  • Security
No Result
View All Result
mexlinux.com
  • Home
  • Hosting
  • Tech
  • Server
  • Security
No Result
View All Result
mexlinux.com
No Result
View All Result

How to set up the NGINX Ingress Controller in Kubernets

admin by admin
July 30, 2020
Home Latest
Share on FacebookShare on Twitter

If we re-run “minikube addons checklist” command, this time we should see the standing of ingress is enabled.

Run following kubectl command to confirm whether or not ingress controller’s pod is working or not.

Above output confirms that nginx-controller has been enabled and began its pod efficiently beneath kube-system namespace.

Notice: I’m assuming Kubernetes cluster is up and working.

How to set up the NGINX Ingress Controller in KubernetsHow to set up the NGINX Ingress Controller in Kubernets

Run following kubectl command to confirm the standing of nginx-ingress controller pods,

[email protected]:~$ kubectl get pods -n ingress-nginx -l app.kubernetes.io/title=ingress-nginx
NAME                                        READY   STATUS      RESTARTS   AGE
ingress-nginx-admission-create-v7ftn        0/1     Accomplished   0          6m12s
ingress-nginx-admission-patch-njdnf         0/1     Accomplished   0          6m12s
ingress-nginx-controller-75f84dfcd7-p5dct   1/1     Working     0          6m23s
[email protected]:~$

Good, above output confirms that NGINX Ingress Controller has been deployed efficiently and it’s pod is presently working.

Take a look at Ingress Controller

To check Ingress controller, we are going to create two functions based mostly on httpd and nginx container and can expose these functions through their respective companies after which will create ingress useful resource which is able to permit exterior customers to entry these functions utilizing their respective urls.

Deploy httpd based mostly deployment and its service with NodePort kind listening on the port 80, Create the next yaml file which incorporates deployment and repair part,

[[email protected] ~]# vi httpd-deployment.yaml
apiVersion: apps/v1
form: Deployment
metadata:
title: httpd-deployment
spec:
replicas: 1
selector:
matchLabels:
run: httpd-deployment
template:
metadata:
labels:
run: httpd-deployment
spec:
containers:
– picture: httpd
title: httpd-webserver

—
apiVersion: v1
form: Service
metadata:
title: httpd-service
spec:
kind: NodePort
selector:
run: httpd-deployment
ports:
– port: 80

Save and shut the file.

Run kubectl command to deploy above httpd based mostly deployment and its service,

[[email protected] ~]# kubectl create -f httpd-deployment.yaml
deployment.apps/httpd-deployment created
service/httpd-service created
[[email protected] ~]#

Deploy our subsequent NGINX based mostly deployment and its service with NodePort as its kind and port as 80, Content material of yaml file listed under,

[[email protected] ~]# vi nginx-deployment.yaml
apiVersion: apps/v1
form: Deployment
metadata:
title: nginx-deployment
spec:
replicas: 1
selector:
matchLabels:
run: nginx-deployment
template:
metadata:
labels:
run: nginx-deployment
spec:
containers:
– picture: nginx
title: nginx-webserver

—
apiVersion: v1
form: Service
metadata:
title: nginx-service
spec:
kind: NodePort
selector:
run: nginx-deployment
ports:
– port: 80

Save and exit the file

Now run following kubectl command to deploy above nginx based mostly deployment and its service,

[[email protected] ~]# kubectl create -f nginx-deployment.yaml
deployment.apps/nginx-deployment created
service/nginx-service created
[[email protected] ~]#

Run under command to confirm the standing of each deployments and their companies

[[email protected] ~]# kubectl get deployments.apps httpd-deployment
NAME               READY   UP-TO-DATE   AVAILABLE   AGE
httpd-deployment   1/1     1            1           19m
[[email protected] ~]#
[[email protected] ~]# kubectl get deployments.apps nginx-deployment
NAME               READY   UP-TO-DATE   AVAILABLE   AGE
nginx-deployment   1/1     1            1           24m
[[email protected] ~]#
[[email protected] ~]# kubectl get service nginx-service httpd-service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
nginx-service NodePort 10.103.75.91 80:30042/TCP 78m
httpd-service NodePort 10.98.6.131 80:31770/TCP 73m
[[email protected] ~]#

Create and Deploy Ingress Useful resource

Create the next ingress useful resource yaml file which is able to route the request to the respective service based mostly url or path. In our instance we be utilizing url or fqdn.

[[email protected] ~]# vim myweb-ingress.yaml
apiVersion: networking.k8s.io/v1beta1
form: Ingress
metadata:
title: name-based-virtualhost-ingress
spec:
guidelines:
– host: httpd.instance.com
http:
paths:
– backend:
serviceName: httpd-service
servicePort: 80

– host: nginx.instance.com
http:
paths:
– backend:
serviceName: nginx-service
servicePort: 80

save and shut the file.

Execute beneath kubectl command to create above ingress useful resource,

[[email protected] ~]# kubectl create -f myweb-ingress.yaml
ingress.networking.k8s.io/name-based-virtualhost-ingress created
[[email protected] ~]#

Run following to confirm the standing of above created ingress useful resource

[[email protected] ~]# kubectl get ingress name-based-virtualhost-ingress
[[email protected] ~]# kubectl describe ingress name-based-virtualhost-ingressHow to set up the NGINX Ingress Controller in KubernetsHow to set up the NGINX Ingress Controller in Kubernets

Good, above output confirms that ingress assets have been created efficiently.

Earlier than accessing these urls from outdoors of the cluster please ensure so as to add the next entries in hosts file of your system from the place you supposed to entry these.

192.168.1.190                httpd.instance.com
192.168.1.190                nginx.instance.com

Now attempt to entry these URLs from internet browser, kind

http://httpd.instance.com

http://nginx.instance.com

How to set up the NGINX Ingress Controller in KubernetsHow to set up the NGINX Ingress Controller in Kubernets How to set up the NGINX Ingress Controller in KubernetsHow to set up the NGINX Ingress Controller in Kubernets

Nice, above confirms that we’ve efficiently deployed and setup nginx ingress controller in Kubernetes. Please do share your priceless suggestions and feedback.

nginx ingress controller example,kubernetes ingress controller,nginx-ingress controller helm,kubernetes nginx example,kubernetes ingress tutorial,nginx ingress controller bare metal,eks nginx ingress controller,gke nginx ingress

admin

admin

Next Post
How to set up the NGINX Ingress Controller in Kubernets

How do I manage my domain names?

Recommended.

Digital marketing: definition, examples and more

December 15, 2020
How to set up the NGINX Ingress Controller in Kubernets

Why Contextual Marketing Wins Avast

August 15, 2020

Trending.

How to set up the NGINX Ingress Controller in Kubernets

Got Kids? Limit Computer Usage Per Account in Linux With Timekpr-nExt

October 29, 2020
How to set up the NGINX Ingress Controller in Kubernets

How to restart the Ubuntu 20.04-Linux Hint network

September 25, 2020
How to set up the NGINX Ingress Controller in Kubernets

LockBit ransomware seamlessly encrypts 225 systems

May 13, 2020
How to set up the NGINX Ingress Controller in Kubernets

Download Ultimate ‘Security for Management’ Presentation Template

October 30, 2020
How to set up the NGINX Ingress Controller in Kubernets

How to capitalize the first letter of the python string and other uses of the capitalize) (function – Linux Hint

May 5, 2020
mexlinux.com

MexLinux.com

We develop for Linux for a living, We used to develop for DOS.
Going from DOS to Linux is like trading a glider for an F117.

Categories

  • Hosting
  • Latest
  • Security
  • Server
  • Tech

Recent News

How to set up the NGINX Ingress Controller in Kubernets

Delivering value to a remote workforce: A practical approach

November 19, 2020
How to set up the NGINX Ingress Controller in Kubernets

Tetrade hackers target 112 financial apps with Ghimob banking TrojanSecurity Affairs

November 18, 2020
  • Home
  • Hosting
  • Tech
  • Server
  • Security

© 2020 MexLinux - Sitemap

No Result
View All Result
  • Home
  • Hosting
  • Tech
  • Server
  • Security

© 2020 MexLinux - Sitemap