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

feat: added support for shared and non-shared volumes #141

Merged
merged 1 commit into from
Nov 10, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
labels:
org.edgexfoundry.service: {{.Values.edgex.app.appservice.rules}}
spec:
{{- if and (eq .Values.edgex.security.enabled true) (eq .Values.edgex.storage.isLocal true)}}
{{- if and (eq .Values.edgex.security.enabled true) (or (eq .Values.edgex.storage.sharedVolumesAccessMode "ReadWriteOnce") (eq .Values.edgex.storage.useHostPath true))}}
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
labels:
org.edgexfoundry.service: {{.Values.edgex.app.consul}}
spec:
{{- if and (eq .Values.edgex.security.enabled true) (eq .Values.edgex.storage.isLocal true)}}
{{- if and (eq .Values.edgex.security.enabled true) (or (eq .Values.edgex.storage.sharedVolumesAccessMode "ReadWriteOnce") (eq .Values.edgex.storage.useHostPath true))}}
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
labels:
org.edgexfoundry.service: {{.Values.edgex.app.core.command}}
spec:
{{- if and (eq .Values.edgex.security.enabled true) (eq .Values.edgex.storage.isLocal true)}}
{{- if and (eq .Values.edgex.security.enabled true) (or (eq .Values.edgex.storage.sharedVolumesAccessMode "ReadWriteOnce") (eq .Values.edgex.storage.useHostPath true))}}
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
labels:
org.edgexfoundry.service: {{.Values.edgex.app.core.data}}
spec:
{{- if and (eq .Values.edgex.security.enabled true) (eq .Values.edgex.storage.isLocal true)}}
{{- if and (eq .Values.edgex.security.enabled true) (or (eq .Values.edgex.storage.sharedVolumesAccessMode "ReadWriteOnce") (eq .Values.edgex.storage.useHostPath true))}}
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
labels:
org.edgexfoundry.service: {{.Values.edgex.app.device.rest}}
spec:
{{- if and (eq .Values.edgex.security.enabled true) (eq .Values.edgex.storage.isLocal true)}}
{{- if and (eq .Values.edgex.security.enabled true) (or (eq .Values.edgex.storage.sharedVolumesAccessMode "ReadWriteOnce") (eq .Values.edgex.storage.useHostPath true))}}
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
labels:
org.edgexfoundry.service: {{.Values.edgex.app.device.virtual}}
spec:
{{- if and (eq .Values.edgex.security.enabled true) (eq .Values.edgex.storage.isLocal true)}}
{{- if and (eq .Values.edgex.security.enabled true) (or (eq .Values.edgex.storage.sharedVolumesAccessMode "ReadWriteOnce") (eq .Values.edgex.storage.useHostPath true))}}
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ spec:
labels:
org.edgexfoundry.service: {{.Values.edgex.app.ekuiper}}
spec:
{{- if and (eq .Values.edgex.security.enabled true) (eq .Values.edgex.storage.isLocal true)}}
{{- if and (eq .Values.edgex.security.enabled true) (or (eq .Values.edgex.storage.sharedVolumesAccessMode "ReadWriteOnce") (eq .Values.edgex.storage.useHostPath true))}}
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
org.edgexfoundry.service: {{ .Values.edgex.app.bootstrapper}}
topologyKey: "kubernetes.io/hostname"
{{- end}}
{{- end}}
automountServiceAccountToken: false
initContainers:
- name: prep-volumes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
labels:
org.edgexfoundry.service: {{.Values.edgex.app.core.metadata}}
spec:
{{- if and (eq .Values.edgex.security.enabled true) (eq .Values.edgex.storage.isLocal true)}}
{{- if and (eq .Values.edgex.security.enabled true) (or (eq .Values.edgex.storage.sharedVolumesAccessMode "ReadWriteOnce") (eq .Values.edgex.storage.useHostPath true))}}
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
48 changes: 23 additions & 25 deletions deployment/helm/templates/edgex-pv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
#
# SPDX-License-Identifier: Apache-2.0
#
{{- if .Values.edgex.storage.useHostPath }}
{{- if .Values.edgex.storage.useHostPath }}
apiVersion: v1
kind: PersistentVolume
metadata:
name: edgex-consul-config-volume
spec:
storageClassName: "{{.Values.edgex.storage.className}}"
storageClassName: ""
claimRef:
name: consul-config
namespace: {{ .Release.Namespace }}
capacity:
storage: 500Mi
accessModes:
- ReadWriteOnce
- {{.Values.edgex.storage.nonSharedVolumesAccessMode}}
hostPath:
path: "/mnt/edgex-consul-config"
{{- end}}
Expand All @@ -26,14 +26,14 @@ kind: PersistentVolume
metadata:
name: edgex-consul-data-volume
spec:
storageClassName: "{{.Values.edgex.storage.className}}"
storageClassName: ""
claimRef:
name: consul-data
namespace: {{ .Release.Namespace }}
capacity:
storage: 500Mi
accessModes:
- ReadWriteOnce
- {{.Values.edgex.storage.nonSharedVolumesAccessMode}}
hostPath:
path: "/mnt/edgex-consul-data"
{{- end }}
Expand All @@ -44,14 +44,14 @@ kind: PersistentVolume
metadata:
name: edgex-db-volume
spec:
storageClassName: "{{.Values.edgex.storage.className}}"
storageClassName: ""
claimRef:
name: db-data
namespace: {{ .Release.Namespace }}
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
- {{.Values.edgex.storage.nonSharedVolumesAccessMode}}
hostPath:
path: "/mnt/edgex-db"
{{- end }}
Expand All @@ -62,33 +62,32 @@ kind: PersistentVolume
metadata:
name: edgex-kuiper-data
spec:
storageClassName: "{{.Values.edgex.storage.className}}"
storageClassName: ""
claimRef:
name: kuiper-data
namespace: {{ .Release.Namespace }}
capacity:
storage: 128Mi
accessModes:
- ReadWriteOnce
- {{.Values.edgex.storage.nonSharedVolumesAccessMode}}
hostPath:
path: "/mnt/edgex-kuiper-data"
{{- end }}
{{- if .Values.edgex.security.enabled }}
---
{{- if .Values.edgex.storage.useHostPath }}
apiVersion: v1
kind: PersistentVolume
metadata:
name: edgex-secrets-volume
spec:
storageClassName: "{{.Values.edgex.storage.className}}"
storageClassName: ""
claimRef:
name: edgex-secrets
namespace: {{ .Release.Namespace }}
capacity:
storage: 8Mi
accessModes:
- ReadWriteOnce
- {{.Values.edgex.storage.sharedVolumesAccessMode}}
hostPath:
path: "/tmp/edgex/secrets"
{{- end }}
Expand All @@ -99,14 +98,14 @@ kind: PersistentVolume
metadata:
name: edgex-init-volume
spec:
storageClassName: "{{.Values.edgex.storage.className}}"
storageClassName: ""
claimRef:
name: edgex-init
namespace: {{ .Release.Namespace }}
capacity:
storage: 128Mi
accessModes:
- ReadWriteOnce
- {{.Values.edgex.storage.sharedVolumesAccessMode}}
hostPath:
path: "/mnt/edgex-init-volume"
{{- end }}
Expand All @@ -117,14 +116,14 @@ kind: PersistentVolume
metadata:
name: edgex-vault-data-volume
spec:
storageClassName: "{{.Values.edgex.storage.className}}"
storageClassName: ""
claimRef:
name: vault-file
namespace: {{ .Release.Namespace }}
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
- {{.Values.edgex.storage.nonSharedVolumesAccessMode}}
hostPath:
path: "/mnt/edgex-vault-data"
{{- end }}
Expand All @@ -135,14 +134,14 @@ kind: PersistentVolume
metadata:
name: edgex-vault-logs-volume
spec:
storageClassName: "{{.Values.edgex.storage.className}}"
storageClassName: ""
claimRef:
name: vault-logs
namespace: {{ .Release.Namespace }}
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
- {{.Values.edgex.storage.nonSharedVolumesAccessMode}}
hostPath:
path: "/mnt/edgex-vault-logs"
{{- end }}
Expand All @@ -153,14 +152,14 @@ kind: PersistentVolume
metadata:
name: edgex-vault-config-volume
spec:
storageClassName: "{{.Values.edgex.storage.className}}"
storageClassName: ""
claimRef:
name: vault-config
namespace: {{ .Release.Namespace }}
capacity:
storage: 8Mi
accessModes:
- ReadWriteOnce
- {{.Values.edgex.storage.nonSharedVolumesAccessMode}}
hostPath:
path: "/mnt/edgex-vault-config"
{{- end }}
Expand All @@ -171,14 +170,14 @@ kind: PersistentVolume
metadata:
name: edgex-redis-config-volume
spec:
storageClassName: "{{.Values.edgex.storage.className}}"
storageClassName: ""
claimRef:
name: redis-config
namespace: {{ .Release.Namespace }}
capacity:
storage: 8Mi
accessModes:
- ReadWriteOnce
- {{.Values.edgex.storage.nonSharedVolumesAccessMode}}
hostPath:
path: "/mnt/edgex-redis-config"
{{- end }}
Expand All @@ -189,15 +188,14 @@ kind: PersistentVolume
metadata:
name: edgex-consul-acl-token-volume
spec:
storageClassName: "{{.Values.edgex.storage.className}}"
storageClassName: ""
claimRef:
name: consul-acl-token
namespace: {{ .Release.Namespace }}
capacity:
storage: 8Mi
accessModes:
- ReadWriteOnce
- {{.Values.edgex.storage.nonSharedVolumesAccessMode}}
hostPath:
path: "/mnt/edgex-consul-acl-token"
{{- end }}
{{- end }}
Loading