k8s-ingress-nginx
Ingress nginx controller for kubernetes
Template version:v24-04-20
Helm charts used:ingress-nginx/ingress-nginx v4.10.0
This template contains the configuration files needed to run Ingress NGINX controller in a Kubernetes cluster.
k8s-ingress-nginx
ingress controller uses NGINX as a reverse proxy and load balancer.
To use in your deployments, add the kubernetes.io/ingress.class: nginx
annotation to your Ingress resources.
Note:
k8s-ingress-nginx
should be considered as cluster service. It is recommended to deploy it as a cluster singleton.
Template override parameters
File _values-tpl.yaml
contains template configuration parameters and their default values:
## _values-tpl.yaml## cskygen template default values file#_tplname: k8s-ingress-nginx_tpldescription: Ingress nginx controller for Kubernetes._tplversion: 24-04-20## Values to override### k8s cluster credentials kubeconfig filekubeconfig: config-k8s-modnamespace:## k8s namespace namename: ingress-nginxingressnginx:## LoadBanancer IP static address## Must be previously configured in MetalLBloadbalancerip: 192.168.82.20
TL;DR
- Before deploying, review or modify
loadBalancerIP
value in filevalues-ingress-nginx.yaml
- To deploy namespace and chart:
# Pull charts to './charts/' directory./csdeploy.sh -m pull-charts# Install./csdeploy.sh -m install# Check status./csdeploy.sh -l
Prerequisites
- Administrative access to Kubernetes cluster.
- Helm v3
- Service
k8s-metallb-system
must be deployed andloadBalancerIP
address must be configured as static-pool.
How-to guides
Configure ingress-nginx options
Check loadBalancerIP
and other override configuration values on file values-ingress-nginx.yaml
.
After configuring the desired values, you can install or update the service.
Pull Helm charts
Modify repositories and versions needed in the variable
source_charts
inside the scriptcsdeploy.sh
.To pull the new versions run:
# Pull charts to './charts/' directory./csdeploy.sh -m pull-charts
Note: When pulling new charts, all the content of
./charts
directory will be removed, and replaced by the new pulled charts.
- To redeploy the new versions run:
# Redeploy and upgrade charts./csdeploy.sh -m update
Install
To create namespace and install chart:
# Create namespace and install chart./csdeploy.sh -m install
Update
To update chart settings, change values in file values-ingress-nginx.yaml
.
Redeploy or upgrade the chart running:
# Redeploy chart and update settings./csdeploy.sh -m update
Uninstall
To uninstall chart and remove namespace, run:
# Uninstall chart and remove namespace./csdeploy.sh -m uninstall
Remove
This option is intended to use only to remove the namespace when chart deployment is failed. Otherwise, you must run ./csdeploy.sh -m uninstall
.
To remove namespace and all its contents run:
# Remove namespace and all its contents./csdeploy.sh -m remove
This action deletes the namespace and chart deployment.
Display status
To display namespace and chart status run:
# Display namespace status:csdeploy.sh -l
Reference
To learn more see:
Helm charts and values
Chart | Values |
---|---|
ingress-nginx/ingress-nginx | values-ingress-nginx.yaml |
Scripts
csdeploy
Purpose:ingress-nginx kubernetes configuration.Usage:sudo csdeploy.sh [-l] [-m <execution_mode>] [-h] [-q]Execution modes:-l [list-status] - List current status.-m <execution_mode> - Valid modes are:[pull-charts] - Pull charts to './charts/' directory.[install] - Create namespace, PV's and install charts.[update] - Redeploy or upgrade charts.[uninstall] - Uninstall charts, remove PV's and namespace.[remove] - Remove PV's namespace and all its contents.Options and arguments:-h Help-q Quiet (Nonstop) execution.Examples:# Pull charts to './charts/' directory./csdeploy.sh -m pull-charts# Create namespace, PV's and install charts./csdeploy.sh -m install# Redeploy or upgrade charts./csdeploy.sh -m update# Uninstall charts, remove PV's and namespace./csdeploy.sh -m uninstall# Remove PV's namespace and all its contents./csdeploy.sh -m remove# Display namespace, persistence and charts status:./csdeploy.sh -l
Tasks performed:
${execution_mode} | Tasks | Block / Description |
---|---|---|
[pull-charts] | Pull helm charts from repositories | |
Clean ./charts directory | Remove all contents in ./charts directory. | |
Pull helm charts | Pull new charts according to sourced script in variable source_charts . | |
Show charts | Show Helm charts pulled into ./charts directory. | |
[install] | Create namespace | |
Create namespace | Namespace must be unique in cluster. | |
[update][install] | Deploy charts | |
Deploy charts | Deploy all charts in ./charts directory with upgrade --install options. | |
[uninstall] | Uninstall charts | |
Uninstall charts | Uninstall all charts in ./charts directory. | |
[uninstall][remove] | Remove namespace | |
Remove namespace | Remove namespace and all its objects. | |
[install][update] [list-status] | Display status information | |
Display namespace | Display namespace and object status. | |
Display charts | Charts releases history information. | |
Template values
The following table lists template configuration parameters and their specified values, when machine configuration files were created from the template:
Parameter | Description | Values |
---|---|---|
_tplname | template name | {{ ._tplname }} |
_tpldescription | template description | {{ ._tpldescription }} |
_tplversion | template version | {{ ._tplversion }} |
kubeconfig | kubeconfig file | {{ .kubeconfig }} |
namespace.name | namespace name | {{ .namespace.name }} |
ingressnginx.loadbalancerip | load-balancer IP Address | {{ .ingressnginx.loadbalancerip }} |
License
Copyright © 2021 cSkyLab.com ™
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.