mirror of
https://github.com/bitnami/charts.git
synced 2026-02-15 07:47:12 +08:00
Allow mounting files from files/ directory
This commit is contained in:
@@ -128,7 +128,9 @@ In the following example you can deploy a example web application using git:
|
||||
helm install bitnami/apache --set cloneHtdocsFromGit.enabled=true --set cloneHtdocsFromGit.repository=https://github.com/mdn/beginner-html-site-styled.git --set cloneHtdocsFromGit.branch=master
|
||||
```
|
||||
|
||||
You may also want to mount different virtual host configurations. This can be done using the `vhostsConfigMap` value. This a pointer to a ConfigMap with the desired Apache virtual host configurations.
|
||||
To use your own `httpd.conf` file you can mount it using the `httpdConfConfigMap` parameter, which is the name of a Config Map with the contents of your `httpd.conf`. Additionaly, you can copy your `httpd.conf` to `/files/httpd.conf` in your current working directory to mount it to the container.
|
||||
|
||||
You may also want to mount different virtual host configurations. This can be done using the `vhostsConfigMap` value. This is a pointer to a ConfigMap with the desired Apache virtual host configurations. You can also copy your virtual host configurations under the `files/vhosts/` directory in your current working directory to mount them as a Config Map to the container.
|
||||
|
||||
### [Rolling VS Immutable tags](https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/)
|
||||
|
||||
|
||||
1
bitnami/apache/files/README.md
Normal file
1
bitnami/apache/files/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Copy here your `httpd.conf` file to use mount it as a config map.
|
||||
1
bitnami/apache/files/vhosts/README.md
Normal file
1
bitnami/apache/files/vhosts/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Copy here your `*.conf` virtual host files to have them mounted to the container as a config map.
|
||||
@@ -195,3 +195,25 @@ Also, we can't use a single if because lazy evaluation is not an option
|
||||
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Get the vhosts config map name.
|
||||
*/}}
|
||||
{{- define "apache.vhostsConfigMap" -}}
|
||||
{{- if .Values.vhostsConfigMap -}}
|
||||
{{- printf "%s" (tpl .Values.vhostsConfigMap $) -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-vhosts" (include "apache.fullname" . ) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Get the httpd.conf config map name.
|
||||
*/}}
|
||||
{{- define "apache.httpdConfConfigMap" -}}
|
||||
{{- if .Values.httpdConfConfigMap -}}
|
||||
{{- printf "%s" (tpl .Values.httpdConfConfigMap $) -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-httpd-conf" (include "apache.fullname" . ) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
13
bitnami/apache/templates/configmap-vhosts.yaml
Normal file
13
bitnami/apache/templates/configmap-vhosts.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
{{- if and (.Files.Glob "files/vhosts/*.conf") (not .Values.vhostsConfigMap) }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "apache.fullname" . }}-vhosts
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "apache.fullname" . }}
|
||||
helm.sh/chart: {{ include "apache.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
data:
|
||||
{{ (.Files.Glob "files/vhosts/*.conf").AsConfig | indent 2 }}
|
||||
{{ end }}
|
||||
13
bitnami/apache/templates/configmap.yaml
Normal file
13
bitnami/apache/templates/configmap.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
{{ if and (.Files.Glob "files/httpd.conf") (not .Values.httpdConfConfigMap) }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "apache.fullname" . }}-httpd-conf
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "apache.fullname" . }}
|
||||
helm.sh/chart: {{ include "apache.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
data:
|
||||
{{ (.Files.Glob "files/httpd.conf").AsConfig | indent 2 }}
|
||||
{{ end }}
|
||||
@@ -102,11 +102,11 @@ spec:
|
||||
- name: htdocs
|
||||
mountPath: /app
|
||||
{{- end }}
|
||||
{{- if .Values.vhostsConfigMap }}
|
||||
{{- if or (.Files.Glob "files/vhosts/*.conf") (.Values.vhostsConfigMap) }}
|
||||
- name: vhosts
|
||||
mountPath: /vhosts
|
||||
{{- end }}
|
||||
{{- if .Values.httpdConfConfigMap }}
|
||||
{{- if or (.Files.Glob "files/httpd.conf") (.Values.httpdConfConfigMap) }}
|
||||
- name: httpd-conf
|
||||
mountPath: /opt/bitnami/apache/conf/httpd.conf
|
||||
subPath: httpd.conf
|
||||
@@ -138,15 +138,15 @@ spec:
|
||||
- name: htdocs
|
||||
{{- include "apache.htdocsVolume" . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.vhostsConfigMap }}
|
||||
{{- if or (.Files.Glob "files/vhosts/*.conf") (.Values.vhostsConfigMap) }}
|
||||
- name: vhosts
|
||||
configMap:
|
||||
name: {{ .Values.vhostsConfigMap }}
|
||||
name: {{ include "apache.vhostsConfigMap" . }}
|
||||
{{- end }}
|
||||
{{- if .Values.httpdConfConfigMap }}
|
||||
{{- if or (.Files.Glob "files/httpd.conf") (.Values.httpdConfConfigMap) }}
|
||||
- name: httpd-conf
|
||||
configMap:
|
||||
name: {{ .Values.httpdConfConfigMap }}
|
||||
name: {{ include "apache.httpdConfConfigMap" . }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
|
||||
Reference in New Issue
Block a user