mirror of
https://github.com/wahyd4/charts.git
synced 2026-08-19 18:16:12 +10:00
[incubator/nginx] add option to configure vitual host
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
name: nginx
|
||||
version: 0.3.5
|
||||
version: 0.4.0
|
||||
appVersion: 1.10.2
|
||||
description: Chart for the nginx server
|
||||
keywords:
|
||||
- nginx
|
||||
|
||||
@@ -53,9 +53,10 @@ The command removes all the Kubernetes components associated with the chart and
|
||||
The following tables lists the configurable parameters of the NGINX chart and their default values.
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|-------------------|---------------------------|---------------------|
|
||||
| ----------------- | ------------------------- | ------------------- |
|
||||
| `imageTag` | `bitnami/nginx` image tag | NGINX image version |
|
||||
| `imagePullPolicy` | Image pull policy | `IfNotPresent` |
|
||||
| `vhost` | Custom nginx virtual host | `nil` |
|
||||
|
||||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
|
||||
|
||||
@@ -74,3 +75,25 @@ $ helm install --name my-release -f values.yaml nginx-x.x.x.tgz
|
||||
```
|
||||
|
||||
> **Tip**: You can use the default [values.yaml](values.yaml)
|
||||
|
||||
### Providing a custom virtual host
|
||||
|
||||
You can use the `vhost` value to provide a custom virtual host for NGINX to use.
|
||||
To do this, create a values files with your virtual host:
|
||||
|
||||
_custom-vhost.yaml_
|
||||
```yaml
|
||||
vhost: |-
|
||||
server {
|
||||
listen 0.0.0.0:80;
|
||||
location / {
|
||||
return 200 "hello!";
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Install the chart with this value:
|
||||
|
||||
```console
|
||||
$ helm install --name my-release -f custom-vhost.yaml nginx-x.x.x.tgz
|
||||
```
|
||||
|
||||
@@ -43,6 +43,15 @@ spec:
|
||||
volumeMounts:
|
||||
- name: nginx-data
|
||||
mountPath: /bitnami/nginx
|
||||
{{- if .Values.vhost }}
|
||||
- name: nginx-vhost
|
||||
mountPath: /bitnami/nginx/conf/vhosts
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: nginx-data
|
||||
emptyDir: {}
|
||||
{{- if .Values.vhost }}
|
||||
- name: nginx-vhost
|
||||
configMap:
|
||||
name: {{ template "fullname" . }}
|
||||
{{- end }}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
{{- if .Values.vhost -}}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ template "fullname" . }}
|
||||
labels:
|
||||
app: {{ template "fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
data:
|
||||
vhost.conf: |-
|
||||
{{ .Values.vhost | indent 4 }}
|
||||
{{- end -}}
|
||||
@@ -7,3 +7,18 @@ imageTag: 1.10.2-r3
|
||||
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
|
||||
##
|
||||
imagePullPolicy: IfNotPresent
|
||||
|
||||
# vhost: |-
|
||||
# # example PHP-FPM vhost
|
||||
# server {
|
||||
# listen 0.0.0.0:80;
|
||||
# root /app;
|
||||
# location / {
|
||||
# index index.html index.php;
|
||||
# }
|
||||
# location ~ \.php$ {
|
||||
# fastcgi_pass phpfpm-server:9000;
|
||||
# fastcgi_index index.php;
|
||||
# include fastcgi.conf;
|
||||
# }
|
||||
# }
|
||||
|
||||
Reference in New Issue
Block a user