-
Notifications
You must be signed in to change notification settings - Fork 0
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
Extra labels #13
Extra labels #13
Conversation
Resources access data node
@@ -26,6 +26,9 @@ spec: | |||
app: {{ template "timescaledb.fullname" . }} | |||
release: {{ .Release.Name }} | |||
timescaleNodeType: access | |||
{{ with .Values.accessNode.extraPodLabels -}} | |||
{{ toYaml . }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation
{{- with .Values.accessNode.extraPodLabels }}
{{ toYaml . | nindent 6/8}}
{{- end }}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested and renders correctly:
helm template timescaledb -f values.yaml -s templates/statefulset-timescaledb-accessnode.yaml .
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: timescaledb-access
labels:
app: timescaledb
chart: timescaledb-multinode-0.9.0
release: timescaledb
heritage: Helm
spec:
serviceName: timescaledb-access
replicas: 1
podManagementPolicy: Parallel
selector:
matchLabels:
app: timescaledb
release: timescaledb
timescaleNodeType: access
template:
metadata:
name: timescaledb-access
labels:
app: timescaledb
release: timescaledb
timescaleNodeType: access
app.kubernetes.io/part-of: globalcatalog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(us-east-1.playground):/tmp/timescaledb-kubernetes/charts/timescaledb-multinode$ git diff
diff --git a/charts/timescaledb-multinode/templates/statefulset-timescaledb-accessnode.yaml b/charts/timescaledb-multinode/templates/statefulset-timescaledb-accessnode.yaml
index 55ab134..467c6fa 100644
--- a/charts/timescaledb-multinode/templates/statefulset-timescaledb-accessnode.yaml
+++ b/charts/timescaledb-multinode/templates/statefulset-timescaledb-accessnode.yaml
@@ -26,8 +26,8 @@ spec:
app: {{ template "timescaledb.fullname" . }}
release: {{ .Release.Name }}
timescaleNodeType: access
- {{ with .Values.accessNode.extraPodLabels -}}
- {{ toYaml . }}
+ {{- with .Values.accessNode.extraPodLabels }}
+ {{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ template "timescaledb.serviceAccountName" . }}
diff --git a/charts/timescaledb-multinode/values.yaml b/charts/timescaledb-multinode/values.yaml
index f264fb6..e269647 100644
--- a/charts/timescaledb-multinode/values.yaml
+++ b/charts/timescaledb-multinode/values.yaml
@@ -35,7 +35,9 @@ env:
value: /var/lib/postgresql/pgdata
accessNode:
- extraPodLabels: {}
+ extraPodLabels:
+ test: one
+ another: test
#enable external access using LoadBalancer
service:
type: LoadBalancer
(us-east-1.playground):/tmp/timescaledb-kubernetes/charts/timescaledb-multinode$ helm template . | grep test -A 2 -B 2
release: RELEASE-NAME
timescaleNodeType: access
another: test
test: one
spec:
serviceAccountName: RELEASE-NAME-timescaledb
(us-east-1.playground):/tmp/timescaledb-kubernetes/charts/timescaledb-multinode$ git checkout templates/statefulset-timescaledb-accessnode.yaml
Updated 1 path from the index
(us-east-1.playground):/tmp/timescaledb-kubernetes/charts/timescaledb-multinode$ git diff
diff --git a/charts/timescaledb-multinode/values.yaml b/charts/timescaledb-multinode/values.yaml
index f264fb6..e269647 100644
--- a/charts/timescaledb-multinode/values.yaml
+++ b/charts/timescaledb-multinode/values.yaml
@@ -35,7 +35,9 @@ env:
value: /var/lib/postgresql/pgdata
accessNode:
- extraPodLabels: {}
+ extraPodLabels:
+ test: one
+ another: test
#enable external access using LoadBalancer
service:
type: LoadBalancer
(us-east-1.playground):/tmp/timescaledb-kubernetes/charts/timescaledb-multinode$ helm template . | grep test -A 2 -B 2
Error: YAML parse error on timescaledb-multinode/templates/statefulset-timescaledb-accessnode.yaml: error converting YAML to JSON: yaml: line 31: mapping values are not allowed in this context
Use --debug flag to render out invalid YAML
@@ -27,7 +27,7 @@ spec: | |||
release: {{ .Release.Name }} | |||
timescaleNodeType: access | |||
{{ with .Values.accessNode.extraPodLabels -}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{ with .Values.accessNode.extraPodLabels -}} | |
{{- with .Values.accessNode.extraPodLabels }} |
-
should be on the left side, not on the right to reduce confusion
that's probably the reason this odd thing is working
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved the -
but it's the same correct render
Also tried with but still renders correctly
{{- if .Values.dataNode.extraPodLabels }}
{{ toYaml .Values.dataNode.extraPodLabels }}
{{- end }}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move -
to the left
charts/timescaledb-multinode/templates/statefulset-timescaledb-accessnode.yaml
Outdated
Show resolved
Hide resolved
@@ -27,7 +27,7 @@ spec: | |||
release: {{ .Release.Name }} | |||
timescaleNodeType: access | |||
{{ with .Values.accessNode.extraPodLabels -}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move -
to the left
committed by mistake
add suupport for extraPodLabels