nginx
by Dysnix
Chart for the nginx server
About this chart
NGINX
NGINX (pronounced "engine-x") is an open source reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as well as a load balancer, HTTP cache, and a web server (origin server).
TL;DR
$ helm repo add bitnami https://charts.bitnami.com/bitnami
$ helm install my-release bitnami/nginx
Introduction
Bitnami charts for Helm are carefully engineered, actively maintained and are the quickest and easiest way to deploy containers on a Kubernetes cluster that are ready to handle production workloads.
This chart bootstraps a NGINX Open Source deployment on a Kubernetes cluster using the Helm package manager.
Bitnami charts can be used with Kubeapps for deployment and management of Helm Charts in clusters. This Helm chart has been tested on top of Bitnami Kubernetes Production Runtime (BKPR). Deploy BKPR to get automated TLS certificates, logging and monitoring for your applications.
Prerequisites
- Kubernetes 1.12+
- Helm 2.12+ or Helm 3.0-beta3+
Installing the Chart
To install the chart with the release name my-release:
$ helm repo add bitnami https://charts.bitnami.com/bitnami
$ helm install my-release bitnami/nginx
These commands deploy NGINX Open Source on the Kubernetes cluster in the default configuration.
Tip: List all releases using
helm list
Uninstalling the Chart
To uninstall/delete the my-release deployment:
$ helm delete my-release
The command removes all the Kubernetes components associated with the chart and deletes the release.
Parameters
The following tables lists the configurable parameters of the NGINX chart and their default values per section/component:
Global parameters
| Parameter | Description | Default |
|---|---|---|
global.imageRegistry | Global Docker image registry | nil |
global.imagePullSecrets | Global Docker registry secret names as an array | [] (does not add image pull secrets to deployed pods) |
Common parameters
| Parameter | Description | Default |
|---|---|---|
nameOverride | String to partially override nginx.fullname | nil |
fullnameOverride | String to fully override nginx.fullname | nil |
clusterDomain | Default Kubernetes cluster domain | cluster.local |
commonLabels | Labels to add to all deployed objects | {} |
commonAnnotations | Annotations to add to all deployed objects | {} |
extraDeploy | Array of extra objects to deploy with the release | [] (evaluated as a template) |
NGINX parameters
| Parameter | Description | Default |
|---|---|---|
image.registry | NGINX image registry | docker.io |
image.repository | NGINX image name | bitnami/nginx |
image.tag | NGINX image tag | {TAG_NAME} |
image.pullPolicy | NGINX image pull policy | IfNotPresent |
image.pullSecrets | Specify docker-registry secret names as an array | [] (does not add image pull secrets to deployed pods) |
image.debug | Set to true if you would like to see extra information on logs | false |
command | Override default container command (useful when using custom images) | nil |
args | Override default container args (useful when using custom images) | nil |
extraEnvVars | Extra environment variables to be set on NGINX containers | [] |
extraEnvVarsCM | Name of existing ConfigMap containing extra env vars | nil |
extraEnvVarsSecret | Name of existing Secret containing extra env vars | nil |
NGINX deployment parameters
| Parameter | Description | Default |
|---|---|---|
replicaCount | Number of NGINX replicas to deploy | 1 |
strategyType | Deployment Strategy Type | RollingUpdate |
podAffinityPreset | Pod affinity preset. Ignored if affinity is set. Allowed values: soft or hard | "" |
podAntiAffinityPreset | Pod anti-affinity preset. Ignored if affinity is set. Allowed values: soft or hard | soft |
nodeAffinityPreset.type | Node affinity preset type. Ignored if affinity is set. Allowed values: soft or hard | "" |
nodeAffinityPreset.key | Node label key to match Ignored if affinity is set. | "" |
nodeAffinityPreset.values | Node label values to match. Ignored if affinity is set. | [] |
affinity | Affinity for pod assignment | {} (evaluated as a template) |
nodeSelector | Node labels for pod assignment | {} (evaluated as a template) |
tolerations | Tolerations for pod assignment | [] (evaluated as a template) |
podLabels | Additional labels for NGINX pods | {} (evaluated as a template) |
podAnnotations | Annotations for NGINX pods | {} (evaluated as a template) |
podSecurityContext | NGINX pods' Security Context | Check values.yaml file |
containerSecurityContext | NGINX containers' Security Context | Check values.yaml file |
containerPorts.http | Sets http port inside NGINX container | 8080 |
containerPorts.https | Sets https port inside NGINX container | nil |
resources.limits | The resources limits for the NGINX container | {} |
resources.requests | The requested resources for the NGINX container | {} |
livenessProbe | Liveness probe configuration for NGINX | Check values.yaml file |
readinessProbe | Readiness probe configuration for NGINX | Check values.yaml file |
customLivenessProbe | Override default liveness probe | nil |
customReadinessProbe | Override default readiness probe | nil |
autoscaling.enabled | Enable autoscaling for NGINX deployment | false |
autoscaling.minReplicas | Minimum number of replicas to scale back | nil |
autoscaling.maxReplicas | Maximum number of replicas to scale out | nil |
autoscaling.targetCPU | Target CPU utilization percentage | nil |
autoscaling.targetMemory | Target Memory utilization percentage | nil |
extraVolumes | Array to add extra volumes | [] (evaluated as a template) |
extraVolumeMounts | Array to add extra mount | [] (evaluated as a template) |
Custom NGINX application parameters
| Parameter | Description | Default |
|---|---|---|
cloneStaticSiteFromGit.enabled | Get the server static content from a GIT repository | false |
cloneStaticSiteFromGit.image.registry | GIT image registry | docker.io |
cloneStaticSiteFromGit.image.repository | GIT image name | bitnami/git |
cloneStaticSiteFromGit.image.tag | GIT image tag | {TAG_NAME} |
cloneStaticSiteFromGit.image.pullPolicy | GIT image pull policy | Always |
cloneStaticSiteFromGit.image.pullSecrets | Specify docker-registry secret names as an array | [] (does not add image pull secrets to deployed pods) |
|
Deploy nginx with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has nginx on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartnginx is pinned at v7.1.8 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply