在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):MithunTechnologiesDevOps/kubernetes-ingress开源软件地址(OpenSource Url):https://github.com/MithunTechnologiesDevOps/kubernetes-ingress开源编程语言(OpenSource Language):开源软件介绍(OpenSource Introduction):What is the Ingress?The Ingress is a Kubernetes resource that lets you configure an HTTP load balancer for applications running on Kubernetes, represented by one or more Services. Such a load balancer is necessary to deliver those applications to clients outside of the Kubernetes cluster. The Ingress resource supports the following features:
See the Ingress User Guide to learn more about the Ingress resource. What is the Ingress Controller?The Ingress controller is an application that runs in a cluster and configures an HTTP load balancer according to Ingress resources. The load balancer can be a software load balancer running in the cluster or a hardware or cloud load balancer running externally. Different load balancers require different Ingress controller implementations. In the case of NGINX, the Ingress controller is deployed in a pod along with the load balancer. Installing the Ingress Controller In AWS1. Clone Kubernetes Nginx Ingress Manifests into server where you have kubectl
2. Create a Namespace And SA
3. Create RBAC, Default Secret And Config Map
4. Deploy the Ingress ControllerWe include two options for deploying the Ingress controller:
4.1 Create a DaemonSetWhen you run the Ingress Controller by using a DaemonSet, Kubernetes will create an Ingress controller pod on every node of the cluster.
5. Check that the Ingress Controller is RunningCheck that the Ingress Controller is Running Run the following command to make sure that the Ingress controller pods are running:
6. Get Access to the Ingress ControllerIf you created a daemonset, ports 80 and 443 of the Ingress controller container are mapped to the same ports of the node where the container is running. To access the Ingress controller, use those ports and an IP address of any node of the cluster where the Ingress controller is running. 6.1 Service with the Type LoadBalancerCreate a service with the type LoadBalancer. Kubernetes will allocate and configure a cloud load balancer for load balancing the Ingress controller pods. For AWS, run:
To get the DNS name of the ELB, run:
You can resolve the DNS name into an IP address using
7. Ingress Resource:5.1 Define path based or host based routing rules for your services.Single DNS Sample with host and servcie place holdersapiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-resource-1
spec:
ingressClassName: nginx
rules:
- host: <DomainNameOne>
http:
paths:
# Default Backend (Root /)
- backend:
serviceName: <serviceName>
servicePort: 80 Multiple DNS Sample with hosts and servcies place holdersapiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-resource-1
spec:
ingressClassName: nginx
rules:
- host: <DomainNameOne>
http:
paths:
- backend:
serviceName: <serviceNameOne>
servicePort: 80
- host: <DomainNameTwo>
http:
paths:
- backend:
serviceName: <serviceNamTwo>
servicePort: 80 Path Based Routing ExampleapiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-resource-1
spec:
ingressClassName: nginx
rules:
- host: springboot.example.com
http:
paths:
# Default Path(/)
- backend:
serviceName: springboot
servicePort: 80
- path: /java-web-app
backend:
serviceName: javawebapp
servicePort: 80
Uninstall the Ingress ControllerDelete the
Note: If RBAC is enabled on your cluster and you completed step 2, you will need to remove the ClusterRole and ClusterRoleBinding created in that step:
Ingress with Https Using Self Signed Certificates:Generate self signed certificates
Mention tls/ssl(certificate) details in ingress
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论