Close
    logo                                         

    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 file
    kubeconfig: config-k8s-mod
    namespace:
    ## k8s namespace name
    name: ingress-nginx
    ingressnginx:
    ## LoadBanancer IP static address
    ## Must be previously configured in MetalLB
    loadbalancerip: 192.168.82.20

    TL;DR

    • Before deploying, review or modify loadBalancerIP value in file values-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 and loadBalancerIP 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 script csdeploy.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

    ChartValues
    ingress-nginx/ingress-nginxvalues-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}TasksBlock / Description
    [pull-charts]Pull helm charts from repositories
    Clean ./charts directoryRemove all contents in ./charts directory.
    Pull helm chartsPull new charts according to sourced script in variable source_charts.
    Show chartsShow Helm charts pulled into ./charts directory.
    [install]Create namespace
    Create namespaceNamespace must be unique in cluster.
    [update][install]Deploy charts
    Deploy chartsDeploy all charts in ./charts directory with upgrade --install options.
    [uninstall]Uninstall charts
    Uninstall chartsUninstall all charts in ./charts directory.
    [uninstall][remove]Remove namespace
    Remove namespaceRemove namespace and all its objects.
    [install][update] [list-status]Display status information
    Display namespaceDisplay namespace and object status.
    Display chartsCharts 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:

    ParameterDescriptionValues
    _tplnametemplate name{{ ._tplname }}
    _tpldescriptiontemplate description{{ ._tpldescription }}
    _tplversiontemplate version{{ ._tplversion }}
    kubeconfigkubeconfig file{{ .kubeconfig }}
    namespace.namenamespace name{{ .namespace.name }}
    ingressnginx.loadbalanceripload-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.