Install Ingress and Ingress Controller
In Managed Kubernetes, the Ingress Controller is not pre-installed in the cluster. To create an object Ingress install any Ingress Controller.
Ingress — A mechanism that provides application-level (L7) routing of incoming traffic is provided through the Ingress Controller. Ingress Controller is a proxy server deployed in the Managed Kubernetes cluster. The choice of controller depends on the requirements of the applications deployed in the Managed Kubernetes cluster. See list of existing Ingress Controllers.
Install Ingress Controller
Before creating an Ingress Controller, make sure that the pool has a dedicated quota per public IP address.
We will look at a basic Nginx installation — you can install a different Ingress Controller by official instruction.
Together with the Ingress Controller, a Service of type LoadBalancer will be automatically created (load balancer) with a public IP address. By default, a load balancer of the following type is created Basic with reservation But you can choose the type of load balancer and configure for it other parameters. The load balancer will be the entry point for accessing applications in the cluster, so there is no need to additionally create an internal load balancer.
Without load balancer configuration
With load balancer configuration
-
Add the ingress-nginx repository to Helm:
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
-
Install the Ingress Controller:
helm install ingress-nginx/ingress-nginx --generate-name
-
Check that the Ingress Controller is installed:
kubectl get pods
Command output:
NAME READY STATUS RESTARTS AGE
ingress-nginx-1652172027-controller-6d765d1688-vr7ab 1/1 Running 0 51s -
A new load balancer will be created. It's going to appear in control panels under Cloud platform → Balancers → tab Balancers.
-
Add the ingress-nginx repository to Helm:
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
-
Get the default values and save them to a file
values.yaml
:helm inspect values ingress-nginx/ingress-nginx > values.yaml
-
Add required parameters for the balancer en bloc
annotations
filevalues.yaml
.
Manifest fragment with block annotations
:
metadata:
name: loadbalancer-name
labels:
app: nginx
annotations:
service.beta.kubernetes.io/openstack-internal-load-balancer: "true"
-
Save your changes.
-
Install the Ingress Controller:
helm install ingress-nginx/ingress-nginx --generate-name -f values.yaml
-
Check that the Ingress Controller is installed:
kubectl get pods
Command output:
NAME READY STATUS RESTARTS AGE
ingress-nginx-1652172027-controller-6d765d1688-vr7ab 1/1 Running 0 51s -
A new load balancer will be created. It's going to appear in control panels under Cloud platform → Balancers → tab Balancers.
Create Ingress
Manifesto example:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: minimal-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
- path: /testpath
pathType: Prefix
backend:
service:
name: test
port:
number: 80