Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helm chart support #256

Merged
merged 1 commit into from
Mar 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions helm-chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: nginx-ingress
version: 0.0.1
appVersion: 0.0.1
description: NGINX Ingress Controller
sources:
- https://github.com/nginxinc/kubernetes-ingress/tree/master/helm-chart
keywords:
- ingress
- nginx
maintainers:
- name: Damian Curry
email: [email protected]

69 changes: 69 additions & 0 deletions helm-chart/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# NGINX Ingress Controller Helm Chart

## Introduction

This chart deploys the NGINX Ingress controller in your Kubernetes cluster.

## Prerequisites

- Kubernetes 1.6+.
- If you’d like to use NGINX Plus, you need to build your own Docker image and push it to your private registry by following the instructions from [here](https://github.com/nginxinc/kubernetes-ingress-internal/blob/master/nginx-controller/README.md).

## Installing the Chart

To install the chart with the release name my-release:

For NGINX:
```console
$ git clone [email protected]:nginxinc/kubernetes-ingress.git
$ helm install --name my-release kubernetes-ingress/helm-chart/
```

For NGINX Plus:
```console
$ git clone [email protected]:nginxinc/kubernetes-ingress.git
$ helm install --name my-release -f kubernetes-ingress/helm-chart/values-plus.yaml kubernetes-ingress/helm-chart/
```

The command deploys the Ingress controller in your Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

> **Tip**: List all releases using helm list

## Uninstalling the Chart

To uninstall/delete the my-release

```console
$ helm delete my-release
```

The command removes all the Kubernetes components associated with the chart and deletes the release.

## Configuration

The following tables lists the configurable parameters of the NGINX Ingress controller chart and their default values.

Parameter | Description | Default
--- | --- | ---
`controller.name` | The name of the Ingress controller daemon set or deployment. | nginx-ingress
`controller.kind` | The kind of the Ingress controller installation - deployment or daemonset. | deployment
`controller.nginxplus` | Should NGINX Plus be deployed. | false
`controller.hostNetwork` | If the nginx deployment / daemonset should run on the host's network namespace. | false
`controller.image.repository` | The image repository of the Ingress controller. | nginxdemos/nginx-ingress
`controller.image.tag` | The tag of the Ingress controller image. | 1.1.1
`controller.image.pullPolicy` | The pull policy for the Ingress controller image. | IfNotPresent
`controller.config.entries` | The entries of the ConfigMap for customizing NGINX configuration. | { }
`controller.defaultTLS.cert` | The TLS certificate for the default HTTPS server. | None
`controller.defaultTLS.key` | The TLS key for the default HTTPS server. | None
`controller.nodeselector` | The node selectorlabels for pod assignment for the Ingress controller pods. | { }
`controller.terminationGracePeriodSeconds` | The termination grace period of the Ingress controller pod. | 30
`controller.tolerations` | The tolerations required for the IBM Cloud Platform installation. | None



## Limitations

This is a preview version of our helm chart. It has limitations including support for cloud installations (except for the IBM Cloud Platform) and RBAC. This version is not suitable for using in production environments.



8 changes: 8 additions & 0 deletions helm-chart/templates/controller-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-config
data:
{{- if .Values.controller.config.entries }}
{{ toYaml .Values.controller.config.entries | indent 2 }}
{{- end }}
54 changes: 54 additions & 0 deletions helm-chart/templates/controller-daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{{- if eq .Values.controller.kind "daemonset" }}
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: {{ .Values.controller.name }}
spec:
selector:
matchLabels:
app: nginx-ingress
template:
metadata:
labels:
app: nginx-ingress
spec:
{{- if .Values.controller.serviceAccountName }}
serviceAccountName: {{ .Values.controller.serviceAccountName }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.controller.terminationGracePeriodSeconds | default 30 }}
{{- if .Values.controller.nodeselector }}
nodeSelector:
{{ toYaml .Values.controller.nodeSelector | indent 8 }}
{{- end }}
{{- if eq .Values.controller.tolerations "icp" }}
tolerations:
- key: "dedicated"
operator: "Exists"
effect: "NoSchedule"
- key: "CriticalAddonsOnly"
operator: "Exists"
{{- end }}
hostNetwork: {{ .Values.controller.hostNetwork }}
containers:
- name: {{ .Values.controller.name }}
image: "{{ .Values.controller.image.repository }}:{{ .Values.controller.image.tag }}"
imagePullPolicy: "{{ .Values.controller.image.pullPolicy }}"
ports:
- name: http
containerPort: 80
hostPort: 80
- name: https
containerPort: 443
hostPort: 443
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
args:
{{- if eq .Values.controller.nginxplus "true" }}
- -nginx-plus
{{- end }}
- -nginx-configmaps=$(POD_NAMESPACE)/nginx-config
- -default-server-tls-secret=$(POD_NAMESPACE)/default-server-secret
{{- end }}
40 changes: 40 additions & 0 deletions helm-chart/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{- if eq .Values.controller.kind "deployment" }}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ .Values.controller.name }}
spec:
replicas: {{ .Values.controller.replicacount | default 1 }}
selector:
matchLabels:
app: nginx-ingress
template:
metadata:
labels:
app: nginx-ingress
spec:
{{- if .Values.controller.serviceAccountName }}
serviceAccountName: {{ .Values.controller.serviceAccountName }}
{{- end }}
hostNetwork: {{ .Values.controller.hostNetwork }}
containers:
- image: "{{ .Values.controller.image.repository }}:{{ .Values.controller.image.tag }}"
name: {{ .Values.controller.name }}
imagePullPolicy: "{{ .Values.controller.image.pullPolicy }}"
ports:
- name: http
containerPort: 80
- name: https
containerPort: 443
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
args:
{{- if eq .Values.controller.nginxplus "true" }}
- -nginx-plus
{{- end }}
- -nginx-configmaps=$(POD_NAMESPACE)/nginx-config
- -default-server-tls-secret=$(POD_NAMESPACE)/default-server-secret
{{- end }}
8 changes: 8 additions & 0 deletions helm-chart/templates/controller-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: default-server-secret
type: Opaque
data:
tls.crt: {{ .Values.controller.defaultTLS.cert | default "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURTVENDQWpHZ0F3SUJBZ0lKQUs5L2NDNWZocDJHTUEwR0NTcUdTSWIzRFFFQkJRVUFNQ0V4SHpBZEJnTlYKQkFNVEZrNUhTVTVZU1c1bmNtVnpjME52Ym5SeWIyeHNaWEl3SGhjTk1UY3dPRE14TVRBeE16UTRXaGNOTVRndwpPRE14TVRBeE16UTRXakFoTVI4d0hRWURWUVFERXhaT1IwbE9XRWx1WjNKbGMzTkRiMjUwY205c2JHVnlNSUlCCklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUF0bXhhMDhadExIaWxleWhOUWN5OUl4ankKWTBYdy9CRmZvM3duMDRsSXRoaGRxbkZ3NTZIVG1RVjIvbnEyRUxMdTNoejNjc3Urc3M5WFEzL3BrbXVwTEE5TApuaVVRZFVNcER4VlE1VFFKRW5CanJ5aXc4RWFlcEp4NUNCYVB5V3ZSZkpPb0pFSW56ZmNaYnE4OEVmQklYOHdtClFCa0xlcnFTVmRYWjBXR3FINVVQVlVZMVBqZXBqSXAyZ0NvbDRMUjM1aHRlSk9OMmZVTEF6cmRGMDBDT092WGsKUzgwRGw5eHdoUkVwVWVySGNuNXZod3BJazNkY3FNS3BxWTY2elF3dStMcFJEM3ZVWjR0eC9VYnlUdStkMkdhVwpWaG1RLy85RmtzUzVBS1d2ZXkrK3pPUTFDZTAxNzhDU0hRYXRDaWFuU2lTT3lwakZtTUZ0N1Mra25pbm9Xd0lECkFRQUJvNEdETUlHQU1CMEdBMVVkRGdRV0JCUlFUODVHRzV6a0QxV3FNSzZvOW8xWWFqUVBXVEJSQmdOVkhTTUUK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OWdqRTM3aml0SUFRd3BHL3FiamQ3Y1ZaR2hlUkQyK3l4ClptTWU3c1BCZEVmcldmK1REYU9lT3B4L2RRcnFyTEc2UXo1ZHlQbXBBb0dBVmsyZ0VnU01wY0RjY253TzRtaXIKWW1zb2VpK0RhQXpISmZxc0JzWjJzNUd5REVteUxDWENDSzFua1FlSjVEV2xJOVZ1ZVRSZldkMHhzNDdxbFRhaApHcWt1eW9zRklSbXpuTjF2RFRtZDNkR1BSTjhqRmF6SWxndWtjTlQ2WkNwbG5oU3QzTjFEbWNvTDl5eGRiSVk2ClZIN2FGcmhFQWpBWDBNSzZMTlNaRFhVQ2dZQlRYc3JWeTBBbFBTY1g2b25XUm9Xb1drZlhBb1lhbDdZZCtyakcKVkZoODhyUnlnNk9YRmFqQTdNSUNjVERXQWFjcFRGdGhGaUtDWHV5Z3BjOXdpMEt2ZlErTU95SlpYRHBOZmNFcAo5OEtWbyt0ZzVQNlRnaXExUUpQNTArbUtqblBxMzhOR3R5UkZVZ2grS1BjWkZ2eUxkRzlwdjlLOCtNVnR5b2ZxCmJzRmhLUUtCZ0NvcEg5Wm95MjJBNStLcnJYZmQ0VXRBcndjN0dVanFUT1hhTzgyd3FpU0hZMndPTGdkWWw0L3kKSDJEYy9EMWxmWS9GL09sckNMZDNpL0lLc0wxNG13R2dxODZRdDhxeTIwcWw4RFNyWG91TmhsQTJmL1ZUTk1SMAp2OXAwU1JrQjI2UVYyUitndnNVYk9xb1lhMlVQVkNuQW9QeTYwTXlBaVJUR3cyeTExbm9lCi0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg==" }}
18 changes: 18 additions & 0 deletions helm-chart/values-icp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
controller:
name: nginx-ingress
kind: daemonset
nginxplus: "true"
hostNetwork: "false"
image:
repository: mycluster.icp:8500/kube-system/nginx-plus-ingress
tag: "1.1.1"
pullPolicy: IfNotPresent
defaultTLS:
cert:
key:
config:
entries: {}
nodeselector: { beta.kubernetes.io/arch: "amd64",
proxy: "true" }
terminationGracePeriodSeconds: 60
tolerations: "icp"
17 changes: 17 additions & 0 deletions helm-chart/values-plus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
controller:
name: nginx-ingress
kind: daemonset
nginxplus: "true"
hostNetwork: "false"
image:
repository: <repo_path>
tag: ""
pullPolicy: IfNotPresent
defaultTLS:
cert:
key:
config:
entries: {}
nodeselector: {}
terminationGracePeriodSeconds: 30
tolerations: ""
17 changes: 17 additions & 0 deletions helm-chart/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
controller:
name: nginx-ingress
kind: deployment
nginxplus: "false"
hostNetwork: "false"
image:
repository: nginxdemos/nginx-ingress
tag: "1.1.1"
pullPolicy: IfNotPresent
config:
entries: {}
defaultTLS:
cert:
key:
nodeselector: {}
terminationGracePeriodSeconds: 30
tolerations: ""