Skip to content

Commit

Permalink
Merge all /srv/www volumes into one
Browse files Browse the repository at this point in the history
Now that all RPM-managed content has been moved away from /srv/www, use
a single volume for it.
  • Loading branch information
cbosdo committed Jan 9, 2024
1 parent feb5e27 commit d31006e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 98 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Merge /srv/www/ volumes and add one for /var/lib/salt
57 changes: 9 additions & 48 deletions containers/server-helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,52 +131,23 @@ spec:
volumeMounts:
- mountPath: /mnt
name: srv-salt
- name: init-srv-www-pub
- name: init-srv-www
image: {{- include "deployment.container.image" (dict "name" "server" "global" .) | indent 1}}
imagePullPolicy: {{ .Values.pullPolicy }}
command:
- sh
- -x
- -c
- >
chown --reference=/srv/www/htdocs/pub /mnt;
chmod --reference=/srv/www/htdocs/pub /mnt;
chown --reference=/srv/www /mnt;
chmod --reference=/srv/www /mnt;
if [ -z "$(ls -A /mnt)" ]; then
cp -a /srv/www/htdocs/pub/. /mnt;
cp -a /srv/www/. /mnt;
ln -s /etc/pki/trust/anchors/LOCAL-RHN-ORG-TRUSTED-SSL-CERT /mnt/RHN-ORG-TRUSTED-SSL-CERT;
fi
volumeMounts:
- mountPath: /mnt
name: srv-www-pub
- name: init-srv-www-cobbler
image: {{- include "deployment.container.image" (dict "name" "server" "global" .) | indent 1}}
imagePullPolicy: {{ .Values.pullPolicy }}
command:
- sh
- -x
- -c
- >
chown --reference=/srv/www/cobbler /mnt;
chmod --reference=/srv/www/cobbler /mnt;
if [ -z "$(ls -A /mnt)" ]; then
cp -a /srv/www/cobbler/. /mnt;
fi
volumeMounts:
- mountPath: /mnt
name: srv-www-cobbler
- name: init-srv-www-osimages
image: {{- include "deployment.container.image" (dict "name" "server" "global" .) | indent 1}}
imagePullPolicy: {{ .Values.pullPolicy }}
command:
- sh
- -x
- -c
- >
chown --reference=/srv/www/os-images /mnt;
chmod --reference=/srv/www/os-images /mnt
volumeMounts:
- mountPath: /mnt
name: srv-www-osimages
name: srv-www
- name: init-srv-tftpboot
image: {{- include "deployment.container.image" (dict "name" "server" "global" .) | indent 1}}
imagePullPolicy: {{ .Values.pullPolicy }}
Expand Down Expand Up @@ -470,12 +441,8 @@ spec:
name: var-log
- mountPath: /srv/salt
name: srv-salt
- mountPath: /srv/www/htdocs/pub
name: srv-www-pub
- mountPath: /srv/www/cobbler
name: srv-www-cobbler
- mountPath: /srv/www/os-images
name: srv-www-osimages
- mountPath: /srv/www
name: srv-www
- mountPath: /srv/tftpboot
name: srv-tftpboot
- mountPath: /srv/formula_metadata
Expand Down Expand Up @@ -570,15 +537,9 @@ spec:
- name: srv-salt
persistentVolumeClaim:
claimName: srv-salt
- name: srv-www-pub
persistentVolumeClaim:
claimName: srv-www-pub
- name: srv-www-cobbler
persistentVolumeClaim:
claimName: srv-www-cobbler
- name: srv-www-osimages
- name: srv-www
persistentVolumeClaim:
claimName: srv-www-osimages
claimName: srv-www
- name: srv-tftpboot
persistentVolumeClaim:
claimName: srv-tftpboot
Expand Down
52 changes: 2 additions & 50 deletions containers/server-helm/templates/volumes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ spec:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: srv-www-pub
name: srv-www
namespace: "{{ .Release.Namespace }}"
spec:
{{- if .Values.storageClass }}
Expand All @@ -187,55 +187,7 @@ spec:
{{- if .Values.matchPvByLabel }}
selector:
matchLabels:
data: srv-www-pub
{{- end }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: srv-www-cobbler
namespace: "{{ .Release.Namespace }}"
spec:
{{- if .Values.storageClass }}
{{- if (eq "-" .Values.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.storageClass }}"
{{- end }}
{{- end }}
accessModes:
{{ toYaml .Values.accessModes | indent 4 }}
resources:
requests:
storage: 100Mi
{{- if .Values.matchPvByLabel }}
selector:
matchLabels:
data: srv-www-cobbler
{{- end }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: srv-www-osimages
namespace: "{{ .Release.Namespace }}"
spec:
{{- if .Values.storageClass }}
{{- if (eq "-" .Values.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.storageClass }}"
{{- end }}
{{- end }}
accessModes:
{{ toYaml .Values.accessModes | indent 4 }}
resources:
requests:
storage: 100Mi
{{- if .Values.matchPvByLabel }}
selector:
matchLabels:
data: srv-www-osimages
data: srv-www
{{- end }}
---
apiVersion: v1
Expand Down

0 comments on commit d31006e

Please sign in to comment.