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: add support for dual stack clusters #84

Merged
merged 1 commit into from
May 28, 2024
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
2 changes: 1 addition & 1 deletion charts/quickwit/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: quickwit
description: Sub-second search & analytics engine on cloud storage.
type: application
version: 0.5.15
version: 0.5.16
appVersion: "v0.8.1"
keywords:
- quickwit
Expand Down
36 changes: 36 additions & 0 deletions charts/quickwit/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ metadata:
{{- end }}
spec:
type: {{ .Values.service.type }}
{{- if .Values.service.ipFamilyPolicy }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
{{- if .Values.service.ipFamilies }}
ipFamilies: {{ .Values.service.ipFamilies | toYaml | nindent 2 }}
{{- end }}
ports:
- port: 7280
targetPort: rest
Expand All @@ -36,6 +42,12 @@ metadata:
{{- end }}
spec:
type: ClusterIP
{{- if .Values.service.ipFamilyPolicy }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
{{- if .Values.service.ipFamilies }}
ipFamilies: {{ .Values.service.ipFamilies | toYaml | nindent 2 }}
{{- end }}
clusterIP: None
publishNotReadyAddresses: true
ports:
Expand Down Expand Up @@ -69,6 +81,12 @@ metadata:
{{- end }}
spec:
type: {{ .Values.service.type }}
{{- if .Values.service.ipFamilyPolicy }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
{{- if .Values.service.ipFamilies }}
ipFamilies: {{ .Values.service.ipFamilies | toYaml | nindent 2 }}
{{- end }}
ports:
- port: 7280
targetPort: rest
Expand All @@ -95,6 +113,12 @@ metadata:
{{- end }}
spec:
type: {{ .Values.service.type }}
{{- if .Values.service.ipFamilyPolicy }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
{{- if .Values.service.ipFamilies }}
ipFamilies: {{ .Values.service.ipFamilies | toYaml | nindent 2 }}
{{- end }}
ports:
- port: 7280
targetPort: rest
Expand All @@ -114,6 +138,12 @@ metadata:
{{- include "quickwit.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
{{- if .Values.service.ipFamilyPolicy }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
{{- if .Values.service.ipFamilies }}
ipFamilies: {{ .Values.service.ipFamilies | toYaml | nindent 2 }}
{{- end }}
ports:
- port: 7280
targetPort: rest
Expand All @@ -134,6 +164,12 @@ metadata:
{{- include "quickwit.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
{{- if .Values.service.ipFamilyPolicy }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
{{- if .Values.service.ipFamilies }}
ipFamilies: {{ .Values.service.ipFamilies | toYaml | nindent 2 }}
{{- end }}
ports:
- port: 7280
targetPort: rest
Expand Down
5 changes: 5 additions & 0 deletions charts/quickwit/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,11 @@ prometheusRule:
service:
type: ClusterIP

# -- Set the ip family policy to configure dual-stack see [Configure dual-stack](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services)
ipFamilyPolicy: ""
# -- Sets the families that should be supported and the order in which they should be applied to ClusterIP as well. Can be IPv4 and/or IPv6.
ipFamilies: []

Comment on lines +429 to +433
Copy link
Collaborator

@rdettai rdettai May 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what the best practice is here.

Suggested change
# -- Set the ip family policy to configure dual-stack see [Configure dual-stack](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services)
ipFamilyPolicy: ""
# -- Sets the families that should be supported and the order in which they should be applied to ClusterIP as well. Can be IPv4 and/or IPv6.
ipFamilies: []
# -- Set the ip family policy to configure dual-stack. See [Configure dual-stack](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services)
# ipFamilyPolicy: "PreferDualStack"
# -- Sets the families that should be supported and the order in which they should be applied to ClusterIP as well. Can be IPv4 and/or IPv6.
# ipFamilies: ["IPv4","IPv6"]

Copy link
Contributor Author

@M0NsTeRRR M0NsTeRRR May 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could comment it out to indicate that it's not a required configuration if you prefer but if you use one day helm-docs to comment helm chart configuration commented field will not appears it's why I did that. However if you want to comment it, I believe it's better to retain the current value to demonstrate the default behavior.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the main benefit of commenting out I think is that when we test it, we test that it is compatible with old configuration that didn't have the value!

I believe it's better to retain the current value to demonstrate the default behavior

What is the default behavior actually? "" and [] are pretty confusing to me.

Copy link
Contributor Author

@M0NsTeRRR M0NsTeRRR May 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the main benefit of commenting out I think is that when we test it, we test that it is compatible with old configuration that didn't have the value!

As you want :)

What is the default behavior actually? "" and [] are pretty confusing to me.

They are not set as they are treated as empty value for gotemplate and use default kubernetes values.

The default kubernetes values are :
ipFamilyPolicy: "SingleStack"
ipFamilies: "" # no value, it depends on cluster configuration and ipFamilyPolicy

https://kubernetes.io/docs/reference/kubernetes-api/service-resources/service-v1/

annotations: {}

ingress:
Expand Down
Loading