1 .. This work is licensed under a Creative Commons Attribution 4.0
2 .. International License.
3 .. http://creativecommons.org/licenses/by/4.0
4 .. Copyright 2020, Samsung Electronics
5 .. Modification copyright (C) 2022 Nordix Foundation
8 .. _metallb Metal Load Balancer installation: https://metallb.universe.tf/installation/
10 .. _oom_setup_ingress_controller:
12 OOM Ingress controller setup
13 ============================
16 This guide should prob go in the Optional addons section
18 This optional guide provides instruction how to setup experimental ingress controller
19 feature. For this, we are hosting our cluster on OpenStack VMs and using the
20 Rancher Kubernetes Engine (RKE) to deploy and manage our Kubernetes Cluster and
29 The result at the end of this tutorial will be:
31 #. Customization of the cluster.yaml file for ingress controller support
33 #. Installation and configuration test DNS server for ingress host resolution
36 #. Installation and configuration MLB (Metal Load Balancer) required for
37 exposing ingress service
39 #. Installation and configuration NGINX ingress controller
41 #. Additional info how to deploy ONAP with services exposed via Ingress
44 Customize cluster.yml file
45 --------------------------
47 Before setup cluster for ingress purposes DNS cluster IP and ingress provider
48 should be configured and following:
62 - <custer_dns_ip>:31555
64 Where the <cluster_dns_ip> should be set to the same IP as the CONTROLPANE
67 For external load balancer purposes, minimum one of the worker node should be
68 configured with external IP address accessible outside the cluster. It can be
69 done using the following example node configuration:
75 - address: <external_ip>
76 internal_address: <internal_ip>
80 hostname_override: "onap-worker-0"
82 ssh_key_path: "~/.ssh/id_rsa"
85 Where the <external_ip> is external worker node IP address, and <internal_ip>
86 is internal node IP address if it is required.
89 DNS server configuration and installation
90 -----------------------------------------
92 DNS server deployed on the Kubernetes cluster makes it easy to use services
93 exposed through ingress controller because it resolves all subdomain related to
94 the ONAP cluster to the load balancer IP. Testing ONAP cluster requires a lot
95 of entries on the target machines in the /etc/hosts. Adding many entries into
96 the configuration files on testing machines is quite problematic and error
97 prone. The better wait is to create central DNS server with entries for all
98 virtual host pointed to simpledemo.onap.org and add custom DNS server as a
99 target DNS server for testing machines and/or as external DNS for Kubernetes
102 DNS server has automatic installation and configuration script, so installation
105 > cd kubernetes/contrib/dns-server-for-vhost-ingress-testing
109 After DNS deploy you need to setup DNS entry on the target testing machine.
110 Because DNS listen on non standard port configuration require iptables rules
111 on the target machine. Please follow the configuration proposed by the deploy
113 Example output depends on the IP address and example output looks like bellow::
115 DNS server already deployed:
116 1. You can add the DNS server to the target machine using following commands:
117 sudo iptables -t nat -A OUTPUT -p tcp -d 192.168.211.211 --dport 53 -j DNAT --to-destination 10.10.13.14:31555
118 sudo iptables -t nat -A OUTPUT -p udp -d 192.168.211.211 --dport 53 -j DNAT --to-destination 10.10.13.14:31555
119 sudo sysctl -w net.ipv4.conf.all.route_localnet=1
120 sudo sysctl -w net.ipv4.ip_forward=1
121 2. Update /etc/resolv.conf file with nameserver 192.168.211.211 entry on your target machine
124 MetalLB Load Balancer installation and configuration
125 ----------------------------------------------------
127 By default pure Kubernetes cluster requires external load balancer if we want
128 to expose external port using LoadBalancer settings. For this purpose MetalLB
129 can be used. Before installing the MetalLB you need to ensure that at least one
130 worker has assigned IP accessible outside the cluster.
132 MetalLB Load balancer can be easily installed using automatic install script::
134 > cd kubernetes/contrib/metallb-loadbalancer-inst
136 > ./install-metallb-on-cluster.sh
139 Configuration of the Nginx ingress controller
140 ---------------------------------------------
142 After installation of the DNS server and ingress controller, we can install and
143 configure ingress controller.
144 It can be done using the following commands::
146 > cd kubernetes/contrib/ingress-nginx-post-inst
148 > kubectl apply -f nginx_ingress_cluster_config.yaml
150 > kubectl apply -f nginx_ingress_enable_optional_load_balacer_service.yaml
152 After deploying the NGINX ingress controller, you can ensure that the ingress port is
153 exposed as load balancer service with an external IP address::
155 > kubectl get svc -n ingress-nginx
156 NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
157 default-http-backend ClusterIP 10.10.10.10 <none> 80/TCP 25h
158 ingress-nginx LoadBalancer 10.10.10.11 10.12.13.14 80:31308/TCP,443:30314/TCP 24h
161 ONAP with ingress exposed services
162 ----------------------------------
164 If you want to deploy onap with services exposed through ingress controller you
165 can use full onap deploy yaml::
167 > onap/resources/overrides/onap-all-ingress-nginx-vhost.yaml
169 Ingress also can be enabled on any onap setup override using following code: