-
Notifications
You must be signed in to change notification settings - Fork 1
Description
From https://github.com/tigerpeng2001/graylog-helm/blob/main/evaluation.txt
DataNode uses volumeMount name native-libs:
| volumeMounts: | |
| - name: "data" | |
| mountPath: {{ .Values.datanode.persistence.data.mountPath | default "/var/lib/graylog-datanode" | quote }} | |
| - name: native-libs | |
| mountPath: {{ .Values.datanode.persistence.nativeLibs.mountPath | default "/native_libs" | quote }} |
Which it also uses for the corresponding default emptyDir volume:
graylog-helm/charts/graylog/templates/workload/statefulsets/datanode.yaml
Lines 131 to 135 in 5ffb072
| volumes: | |
| {{- if not .Values.datanode.persistence.nativeLibs.enabled }} | |
| - name: native-libs | |
| emptyDir: {} | |
| {{- end }} |
But the PVC template name is nativeLibs:
graylog-helm/charts/graylog/templates/workload/statefulsets/datanode.yaml
Lines 162 to 165 in 5ffb072
| {{- if .Values.datanode.persistence.nativeLibs.enabled }} | |
| - metadata: | |
| name: nativeLibs | |
| spec: |
How to reproduce?
By running
helm template graylog ./charts/graylog | grep -A 120 "statefulsets/datanode.yaml"The following YAML should be rendered:
Click to show/hide
# Source: graylog/templates/workload/statefulsets/datanode.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: graylog-datanode
labels:
app: graylog-datanode
helm.sh/chart: graylog-1.0.0
app.kubernetes.io/name: graylog
app.kubernetes.io/instance: graylog
app.kubernetes.io/version: "7.0"
app.kubernetes.io/managed-by: Helm
spec:
replicas: 3
serviceName: graylog-datanode-svc
selector:
matchLabels:
app: graylog-datanode
app.kubernetes.io/name: graylog
app.kubernetes.io/instance: graylog
updateStrategy:
# (...)
template:
metadata:
# (...)
spec:
dnsPolicy: ClusterFirst
serviceAccountName: graylog-sa
containers:
- name: graylog-datanode
image: graylog/graylog-datanode:7.0
# (...)
volumeMounts:
- name: "data"
mountPath: "/var/lib/graylog-datanode"
- name: native-libs
mountPath: "/native_libs"
#(...)
volumes:
- name: native-libs
emptyDir: {}
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: "8Gi"
---with both the volumeMounts item and the corresponding volumes one match.
But, by running
helm template graylog ./charts/graylog --set datanode.persistence.nativeLibs.enabled=true | grep -A 120 "statefulsets/datanode.yaml"The following YAML is rendered:
Click to show/hide
# Source: graylog/templates/workload/statefulsets/datanode.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: graylog-datanode
labels:
app: graylog-datanode
helm.sh/chart: graylog-1.0.0
app.kubernetes.io/name: graylog
app.kubernetes.io/instance: graylog
app.kubernetes.io/version: "7.0"
app.kubernetes.io/managed-by: Helm
spec:
replicas: 3
serviceName: graylog-datanode-svc
selector:
matchLabels:
app: graylog-datanode
app.kubernetes.io/name: graylog
app.kubernetes.io/instance: graylog
updateStrategy:
# (...)
template:
metadata:
# (...)
spec:
dnsPolicy: ClusterFirst
serviceAccountName: graylog-sa
containers:
- name: graylog-datanode
image: graylog/graylog-datanode:7.0
# (...)
volumeMounts:
- name: "data"
mountPath: "/var/lib/graylog-datanode"
- name: native-libs
mountPath: "/native_libs"
# (...)
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: "8Gi"
- metadata:
name: nativeLibs
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: "2Gi"
---with the volumeMounts item (native-libs) and the volumes one (nativeLibs) not matching.
Then, when trying to install the chart with datanode.persistence.nativeLibs.enabled=true:
helm install graylog graylog/graylog --set datanode.persistence.nativeLibs.enabled=trueThe graylog-datanodes won't be scheduled:
kubectl get pods | grep datanodeAnd by describing the corresponding Statefulset:
kubectl describe sts graylog-datanodeWe get the following Events:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedCreate 3m55s (x12 over 4m6s) statefulset-controller create Pod graylog-datanode-0 in StatefulSet graylog-datanode failed error: failed to create PVC nativeLibs-graylog-datanode-0: PersistentVolumeClaim "nativeLibs-graylog-datanode-0" is invalid: metadata.name: Invalid value: "nativeLibs-graylog-datanode-0": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
Warning FailedCreate 3m45s (x13 over 4m6s) statefulset-controller create Claim nativeLibs-graylog-datanode-0 for Pod graylog-datanode-0 in StatefulSet graylog-datanode failed error: PersistentVolumeClaim "nativeLibs-graylog-datanode-0" is invalid: metadata.name: Invalid value: "nativeLibs-graylog-datanode-0": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')