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 **************************
46 Before setup cluster for ingress purposes DNS cluster IP and ingress provider
47 should be configured and following:
61 - <custer_dns_ip>:31555
63 Where the <cluster_dns_ip> should be set to the same IP as the CONTROLPANE
66 For external load balancer purposes, minimum one of the worker node should be
67 configured with external IP address accessible outside the cluster. It can be
68 done using the following example node configuration:
74 - address: <external_ip>
75 internal_address: <internal_ip>
79 hostname_override: "onap-worker-0"
81 ssh_key_path: "~/.ssh/id_rsa"
84 Where the <external_ip> is external worker node IP address, and <internal_ip>
85 is internal node IP address if it is required.
88 DNS server configuration and installation
89 *****************************************
90 DNS server deployed on the Kubernetes cluster makes it easy to use services
91 exposed through ingress controller because it resolves all subdomain related to
92 the ONAP cluster to the load balancer IP. Testing ONAP cluster requires a lot
93 of entries on the target machines in the /etc/hosts. Adding many entries into
94 the configuration files on testing machines is quite problematic and error
95 prone. The better wait is to create central DNS server with entries for all
96 virtual host pointed to simpledemo.onap.org and add custom DNS server as a
97 target DNS server for testing machines and/or as external DNS for Kubernetes
100 DNS server has automatic installation and configuration script, so installation
103 > cd kubernetes/contrib/dns-server-for-vhost-ingress-testing
107 After DNS deploy you need to setup DNS entry on the target testing machine.
108 Because DNS listen on non standard port configuration require iptables rules
109 on the target machine. Please follow the configuration proposed by the deploy
111 Example output depends on the IP address and example output looks like bellow::
113 DNS server already deployed:
114 1. You can add the DNS server to the target machine using following commands:
115 sudo iptables -t nat -A OUTPUT -p tcp -d 192.168.211.211 --dport 53 -j DNAT --to-destination 10.10.13.14:31555
116 sudo iptables -t nat -A OUTPUT -p udp -d 192.168.211.211 --dport 53 -j DNAT --to-destination 10.10.13.14:31555
117 sudo sysctl -w net.ipv4.conf.all.route_localnet=1
118 sudo sysctl -w net.ipv4.ip_forward=1
119 2. Update /etc/resolv.conf file with nameserver 192.168.211.211 entry on your target machine
122 MetalLB Load Balancer installation and configuration
123 ****************************************************
125 By default pure Kubernetes cluster requires external load balancer if we want
126 to expose external port using LoadBalancer settings. For this purpose MetalLB
127 can be used. Before installing the MetalLB you need to ensure that at least one
128 worker has assigned IP accessible outside the cluster.
130 MetalLB Load balancer can be easily installed using automatic install script::
132 > cd kubernetes/contrib/metallb-loadbalancer-inst
134 > ./install-metallb-on-cluster.sh
137 Configuration of the Nginx ingress controller
138 *********************************************
140 After installation of the DNS server and ingress controller, we can install and
141 configure ingress controller.
142 It can be done using the following commands::
144 > cd kubernetes/contrib/ingress-nginx-post-inst
146 > kubectl apply -f nginx_ingress_cluster_config.yaml
148 > kubectl apply -f nginx_ingress_enable_optional_load_balacer_service.yaml
150 After deploying the NGINX ingress controller, you can ensure that the ingress port is
151 exposed as load balancer service with an external IP address::
153 > kubectl get svc -n ingress-nginx
154 NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
155 default-http-backend ClusterIP 10.10.10.10 <none> 80/TCP 25h
156 ingress-nginx LoadBalancer 10.10.10.11 10.12.13.14 80:31308/TCP,443:30314/TCP 24h
159 ONAP with ingress exposed services
160 **********************************
161 If you want to deploy onap with services exposed through ingress controller you
162 can use full onap deploy yaml::
164 > onap/resources/overrides/onap-all-ingress-nginx-vhost.yaml
166 Ingress also can be enabled on any onap setup override using following code: