Nginx Ingress Controller

Nginx Ingress Controller is a type of Ingress controller that uses ConfigMap to store the nginx configuration.

Dependencies

None

Install

You can install nginx-ingress in different ways, we recomend to use Master Helmfile.

Install with Master Helmfile

Run following command

helmfile -f /conf/kops/helmfile.yaml --selector namespace=kube-system,chart=nginx-ingress sync

This environment variables can be useful for configure:

Environment variables can be specified in Geodesic Module Dockerfile or in Chamber storage.

Install with custom Helmfile

Add to your Kubernetes Backing Services Helmfile this code

helmfile.yaml

repositories:
- name: cloudposse-incubator
  url: https://charts.cloudposse.com/incubator/

releases:
- name: ingress
  namespace: kube-system
  labels:
    job: kube-system
  chart: cloudposse-incubator/nginx-ingress
  version: 0.1.7
  set:
  - name: replicaCount
    value: 4
  - name: resources.limits.cpu
    value: 20m
  - name: resources.limits.memory
    value: 256Mi
  - name: resources.requests.cpu
    value: 10m
  - name: resources.requests.memory
    value: 128Mi
  - name: nginx-default-backend.replicaCount
    value: 2
  - name: nginx-default-backend.resources.limits.cpu
    value: 2m
  - name: nginx-default-backend.resources.limits.memory
    value: 5Mi
  - name: nginx-default-backend.resources.requests.cpu
    value: 1m
  - name: nginx-default-backend.resources.requests.memory
    value: 3Mi

Then do Helmfile sync follow instructions

Usage

After install you the ingress controller, then you can create Ingress Resources with kubectl or specifying them in Helm Chart values directly or with Helmfile.

Here are some examples:

ingress.yaml

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: chartmuseum
spec:
  rules:
  - host: example.com
    http:
      paths:
      - path: /
        backend:
          serviceName: chartmuseum-service
          servicePort: 80

values.yaml

ingress:
  enabled: true
  hosts:
    example.com:
        - /

helmfile.yaml

repositories:
- name: stable
  url: https://kubernetes-charts.storage.googleapis.com

releases:
- name: charts
  chart: stable/chartmuseum
  version: 1.3.1
  set:
  - name: ingress.enabled
    value: true
  - name: ingress.hosts.example\.com[0]
    value: /

Note

There is no unified specification for helm chart values structure. Different charts may have very different structures to values. The only way to know for sure what is supported is to refer to the chart manifests.

Provided examples are based on the stable/chartmuseum chart https://github.com/kubernetes/charts/blob/master/stable/chartmuseum