Skip to content

Commit

Permalink
Merge pull request #24 from kubeservice-stack/feat-ipv6
Browse files Browse the repository at this point in the history
[feat]  Add ipv4/ipv6 DualStack
  • Loading branch information
dongjiang1989 committed Jun 15, 2023
2 parents f1491d0 + b33dcce commit 26c9a1c
Show file tree
Hide file tree
Showing 37 changed files with 214 additions and 10 deletions.
9 changes: 7 additions & 2 deletions logging/loggie/templates/loggie-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ metadata:
name: {{ template "loggie.name" . }}
namespace: {{ .Release.Namespace }}
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
ipFamilies:
{{ toYaml .Values.service.ipFamilies | indent 2 }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
ports:
{{- if .Values.servicePorts }}
{{ toYaml .Values.servicePorts | nindent 4}}
{{- if .Values.service.servicePorts }}
{{ toYaml .Values.service.servicePorts | nindent 4}}
{{- end }}
selector:
app: loggie
Expand Down
19 changes: 11 additions & 8 deletions logging/loggie/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,17 @@ aggregator:
enabled: true
port: 9196


servicePorts:
- name: monitor
port: 9196
targetPort: 9196
# - name: gprc
# port: 6066
# targetPort: 6066
service:
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack
servicePorts:
- name: monitor
port: 9196
targetPort: 9196
# - name: gprc
# port: 6066
# targetPort: 6066


serviceMonitor:
Expand Down
5 changes: 5 additions & 0 deletions logging/loki/templates/service-headless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ metadata:
{{- end }}
variant: headless
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
ipFamilies:
{{ toYaml .Values.service.ipFamilies | indent 2 }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
clusterIP: None
ports:
- port: {{ .Values.service.port }}
Expand Down
5 changes: 5 additions & 0 deletions logging/loki/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ metadata:
annotations:
{{- toYaml .Values.service.annotations | nindent 4 }}
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
ipFamilies:
{{ toYaml .Values.service.ipFamilies | indent 2 }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
{{- if .Values.service.loadBalancerSourceRanges }}
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions logging/loki/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,9 @@ service:
annotations: {}
labels: {}
targetPort: http-metrics
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack

serviceAccount:
create: true
Expand Down
5 changes: 5 additions & 0 deletions metrics/charts/grafana/templates/headless-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ metadata:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
ipFamilies:
{{ toYaml .Values.service.ipFamilies | indent 2 }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
clusterIP: None
selector:
{{- include "grafana.selectorLabels" . | nindent 4 }}
Expand Down
5 changes: 5 additions & 0 deletions metrics/charts/grafana/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ metadata:
{{ tpl (toYaml . | indent 4) $root }}
{{- end }}
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
ipFamilies:
{{ toYaml .Values.service.ipFamilies | indent 2 }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
{{- if (or (eq .Values.service.type "ClusterIP") (empty .Values.service.type)) }}
type: ClusterIP
{{- if .Values.service.clusterIP }}
Expand Down
5 changes: 5 additions & 0 deletions metrics/charts/kube-state-metrics/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ metadata:
{{- toYaml .Values.service.annotations | nindent 4 }}
{{- end }}
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
ipFamilies:
{{ toYaml .Values.service.ipFamilies | indent 2 }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
type: "{{ .Values.service.type }}"
ports:
- name: "http"
Expand Down
3 changes: 3 additions & 0 deletions metrics/charts/kube-state-metrics/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ service:
loadBalancerSourceRanges: []
clusterIP: ""
annotations: {}
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack

## Additional labels to add to all resources
customLabels: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ metadata:
{{- end }}
namespace: {{ .Release.Namespace }}
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
ipFamilies:
{{ toYaml .Values.service.ipFamilies | indent 2 }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
Expand Down
4 changes: 4 additions & 0 deletions metrics/charts/kubeservice-ebpf-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ service:
port: 80
# Add service annotations.
annotations: {}
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack

# Specify taint tolerations.
tolerations:
- effect: NoSchedule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ metadata:
{{ toYaml .Values.service.annotations | indent 4 }}
{{- end }}
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
ipFamilies:
{{ toYaml .Values.service.ipFamilies | indent 2 }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
Expand Down
3 changes: 3 additions & 0 deletions metrics/charts/prometheus-node-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ service:
listenOnAllInterfaces: true
annotations:
prometheus.io/scrape: "true"
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack

# Additional environment variables that will be passed to the daemonset
env: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ metadata:
{{ toYaml .Values.service.labels | indent 4 }}
{{- end }}
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
ipFamilies:
{{ toYaml .Values.service.ipFamilies | indent 2 }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
Expand Down
3 changes: 3 additions & 0 deletions metrics/charts/prometheus-pingmesh-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ service:
labels: {}
type: ClusterIP
port: 9115
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack

# Only changes container port. Application port can be changed with extraArgs (--web.listen-address=:9115)
# https://github.com/prometheus/pingmesh_exporter/blob/998037b5b40c1de5fee348ffdea8820509d85171/main.go#L55
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ metadata:
{{ toYaml .Values.service.labels | indent 4 }}
{{- end }}
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
ipFamilies:
{{ toYaml .Values.service.ipFamilies | indent 2 }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
type: {{ .Values.service.type }}
ports:
- name: http
Expand Down
3 changes: 3 additions & 0 deletions metrics/charts/prometheus-snmp-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ service:
annotations: {}
type: ClusterIP
port: 9116
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack

## An Ingress resource can provide name-based virtual hosting and TLS
## termination among other things for CouchDB deployments which are accessed
Expand Down
5 changes: 5 additions & 0 deletions metrics/templates/alertmanager/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ metadata:
{{ toYaml .Values.alertmanager.service.annotations | indent 4 }}
{{- end }}
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
{{- if .Values.global.dualStack }}
{{ toYaml .Values.global.dualStack | indent 2 }}
{{- end }}
{{- end }}
{{- if .Values.alertmanager.service.clusterIP }}
clusterIP: {{ .Values.alertmanager.service.clusterIP }}
{{- end }}
Expand Down
5 changes: 5 additions & 0 deletions metrics/templates/alertmanager/serviceperreplica.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ items:
{{ toYaml $serviceValues.annotations | indent 8 }}
{{- end }}
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
{{- if .Values.global.dualStack }}
{{ toYaml .Values.global.dualStack | indent 6 }}
{{- end }}
{{- end }}
{{- if $serviceValues.clusterIP }}
clusterIP: {{ $serviceValues.clusterIP }}
{{- end }}
Expand Down
10 changes: 10 additions & 0 deletions metrics/templates/exporters/calico/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ metadata:
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
namespace: kube-system
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
{{- if .Values.global.dualStack }}
{{ toYaml .Values.global.dualStack | indent 2 }}
{{- end }}
{{- end }}
clusterIP: None
ports:
- name: http-metrics
Expand All @@ -33,6 +38,11 @@ metadata:
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
namespace: kube-system
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
{{- if .Values.global.dualStack }}
{{ toYaml .Values.global.dualStack | indent 2 }}
{{- end }}
{{- end }}
clusterIP: None
ports:
- name: http-metrics
Expand Down
5 changes: 5 additions & 0 deletions metrics/templates/exporters/core-dns/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ metadata:
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
namespace: kube-system
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
{{- if .Values.global.dualStack }}
{{ toYaml .Values.global.dualStack | indent 2 }}
{{- end }}
{{- end }}
clusterIP: None
ports:
- name: http-metrics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ metadata:
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
namespace: kube-system
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
{{- if .Values.global.dualStack }}
{{ toYaml .Values.global.dualStack | indent 2 }}
{{- end }}
{{- end }}
clusterIP: None
ports:
- name: http-metrics
Expand Down
5 changes: 5 additions & 0 deletions metrics/templates/exporters/kube-dns/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ metadata:
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
namespace: kube-system
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
{{- if .Values.global.dualStack }}
{{ toYaml .Values.global.dualStack | indent 2 }}
{{- end }}
{{- end }}
clusterIP: None
ports:
- name: http-metrics-dnsmasq
Expand Down
5 changes: 5 additions & 0 deletions metrics/templates/exporters/kube-etcd/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ metadata:
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
namespace: kube-system
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
{{- if .Values.global.dualStack }}
{{ toYaml .Values.global.dualStack | indent 2 }}
{{- end }}
{{- end }}
clusterIP: None
ports:
- name: http-metrics
Expand Down
5 changes: 5 additions & 0 deletions metrics/templates/exporters/kube-proxy/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ metadata:
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
namespace: kube-system
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
{{- if .Values.global.dualStack }}
{{ toYaml .Values.global.dualStack | indent 2 }}
{{- end }}
{{- end }}
clusterIP: None
ports:
- name: http-metrics
Expand Down
5 changes: 5 additions & 0 deletions metrics/templates/exporters/kube-scheduler/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ metadata:
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
namespace: kube-system
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
{{- if .Values.global.dualStack }}
{{ toYaml .Values.global.dualStack | indent 2 }}
{{- end }}
{{- end }}
clusterIP: None
ports:
- name: http-metrics
Expand Down
5 changes: 5 additions & 0 deletions metrics/templates/exporters/metrics-server/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ metadata:
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
namespace: kube-system
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
{{- if .Values.global.dualStack }}
{{ toYaml .Values.global.dualStack | indent 2 }}
{{- end }}
{{- end }}
clusterIP: None
ports:
- name: http-metrics
Expand Down
5 changes: 5 additions & 0 deletions metrics/templates/exporters/node-local-dns/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ metadata:
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
namespace: kube-system
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
{{- if .Values.global.dualStack }}
{{ toYaml .Values.global.dualStack | indent 2 }}
{{- end }}
{{- end }}
clusterIP: None
ports:
- name: http-metrics
Expand Down
5 changes: 5 additions & 0 deletions metrics/templates/prometheus-operator/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ metadata:
{{ toYaml .Values.prometheusOperator.service.annotations | indent 4 }}
{{- end }}
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
{{- if .Values.global.dualStack }}
{{ toYaml .Values.global.dualStack | indent 2 }}
{{- end }}
{{- end }}
{{- if .Values.prometheusOperator.service.clusterIP }}
clusterIP: {{ .Values.prometheusOperator.service.clusterIP }}
{{- end }}
Expand Down
5 changes: 5 additions & 0 deletions metrics/templates/prometheus/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ metadata:
{{ toYaml .Values.prometheus.service.annotations | indent 4 }}
{{- end }}
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
{{- if .Values.global.dualStack }}
{{ toYaml .Values.global.dualStack | indent 2 }}
{{- end }}
{{- end }}
{{- if .Values.prometheus.service.clusterIP }}
clusterIP: {{ .Values.prometheus.service.clusterIP }}
{{- end }}
Expand Down
5 changes: 5 additions & 0 deletions metrics/templates/prometheus/serviceThanosSidecar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ metadata:
{{ toYaml .Values.prometheus.thanosService.annotations | indent 4 }}
{{- end }}
spec:
{{- if ge (.Capabilities.KubeVersion.Minor|int) 20 }}
{{- if .Values.global.dualStack }}
{{ toYaml .Values.global.dualStack | indent 2 }}
{{- end }}
{{- end }}
type: {{ .Values.prometheus.thanosService.type }}
clusterIP: {{ .Values.prometheus.thanosService.clusterIP }}
{{- if ne .Values.prometheus.thanosService.type "ClusterIP" }}
Expand Down
Loading

0 comments on commit 26c9a1c

Please sign in to comment.