Skip to content

Commit

Permalink
Merge pull request #10 from paritytech/substrate-telemetry
Browse files Browse the repository at this point in the history
add support for externalTrafficPolicy and sessionAffinity
  • Loading branch information
ArshamTeymouri authored Aug 30, 2021
2 parents 2e8848a + 47960bb commit fe07eca
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/substrate-telemetry/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.0.0
version: "2.0.1"

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
18 changes: 18 additions & 0 deletions charts/substrate-telemetry/templates/core-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,24 @@ metadata:
{{- toYaml .Values.service.core.annotations | nindent 4 }}
spec:
type: {{ .Values.service.core.type }}
{{- if (and (eq .Values.service.core.type "ClusterIP") (not (empty .Values.service.core.clusterIP))) }}
clusterIP: {{ .Values.service.clusterIP }}
{{- end }}
{{- if (and (eq .Values.service.core.type "LoadBalancer") (not (empty .Values.service.core.loadBalancerIP))) }}
loadBalancerIP: {{ .Values.service.core.loadBalancerIP }}
{{- end }}
{{- if (and (or (eq .Values.service.core.type "LoadBalancer") (eq .Values.service.core.type "NodePort")) (not (empty .Values.service.core.externalTrafficPolicy))) }}
externalTrafficPolicy: {{ .Values.service.core.externalTrafficPolicy }}
{{- end }}
{{- if (and (or (eq .Values.service.core.type "LoadBalancer") (eq .Values.service.core.type "NodePort")) (not (empty .Values.service.core.sessionAffinity))) }}
sessionAffinity: {{ .Values.service.core.sessionAffinity }}
{{- end }}
{{- if .Values.service.core.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{- range $cidr := .Values.service.core.loadBalancerSourceRanges }}
- {{ $cidr }}
{{- end }}
{{- end }}
ports:
- port: {{ .Values.service.core.port }}
targetPort: {{ .Values.service.core.targetPort }}
Expand Down
18 changes: 18 additions & 0 deletions charts/substrate-telemetry/templates/frontend-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,24 @@ metadata:
{{- toYaml .Values.service.frontend.annotations | nindent 4 }}
spec:
type: {{ .Values.service.frontend.type }}
{{- if (and (eq .Values.service.frontend.type "ClusterIP") (not (empty .Values.service.frontend.clusterIP))) }}
clusterIP: {{ .Values.service.clusterIP }}
{{- end }}
{{- if (and (eq .Values.service.frontend.type "LoadBalancer") (not (empty .Values.service.frontend.loadBalancerIP))) }}
loadBalancerIP: {{ .Values.service.frontend.loadBalancerIP }}
{{- end }}
{{- if (and (or (eq .Values.service.frontend.type "LoadBalancer") (eq .Values.service.frontend.type "NodePort")) (not (empty .Values.service.frontend.externalTrafficPolicy))) }}
externalTrafficPolicy: {{ .Values.service.frontend.externalTrafficPolicy }}
{{- end }}
{{- if (and (or (eq .Values.service.frontend.type "LoadBalancer") (eq .Values.service.frontend.type "NodePort")) (not (empty .Values.service.frontend.sessionAffinity))) }}
sessionAffinity: {{ .Values.service.frontend.sessionAffinity }}
{{- end }}
{{- if .Values.service.frontend.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{- range $cidr := .Values.service.frontend.loadBalancerSourceRanges }}
- {{ $cidr }}
{{- end }}
{{- end }}
ports:
- port: {{ .Values.service.frontend.port }}
targetPort: {{ .Values.service.frontend.targetPort }}
Expand Down
18 changes: 18 additions & 0 deletions charts/substrate-telemetry/templates/shard-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@ metadata:

spec:
type: {{ .Values.service.shard.type }}
{{- if (and (eq .Values.service.shard.type "ClusterIP") (not (empty .Values.service.shard.clusterIP))) }}
clusterIP: {{ .Values.service.clusterIP }}
{{- end }}
{{- if (and (eq .Values.service.shard.type "LoadBalancer") (not (empty .Values.service.shard.loadBalancerIP))) }}
loadBalancerIP: {{ .Values.service.shard.loadBalancerIP }}
{{- end }}
{{- if (and (or (eq .Values.service.shard.type "LoadBalancer") (eq .Values.service.shard.type "NodePort")) (not (empty .Values.service.shard.externalTrafficPolicy))) }}
externalTrafficPolicy: {{ .Values.service.shard.externalTrafficPolicy }}
{{- end }}
{{- if (and (or (eq .Values.service.shard.type "LoadBalancer") (eq .Values.service.shard.type "NodePort")) (not (empty .Values.service.shard.sessionAffinity))) }}
sessionAffinity: {{ .Values.service.shard.sessionAffinity }}
{{- end }}
{{- if .Values.service.shard.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{- range $cidr := .Values.service.shard.loadBalancerSourceRanges }}
- {{ $cidr }}
{{- end }}
{{- end }}
ports:
- port: {{ .Values.service.shard.port }}
targetPort: {{ .Values.service.shard.targetPort }}
Expand Down
12 changes: 9 additions & 3 deletions charts/substrate-telemetry/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,26 @@ service:
type: ClusterIP
port: 80
targetPort: 8000
# nodePort: 31000
annotations: {}
# nodePort: 31000
# externalTrafficPolicy: Cluster
# sessionAffinity: None
core:
type: ClusterIP
port: 80
targetPort: 8000
# nodePort: 31000
annotations: {}
# nodePort: 31000
# externalTrafficPolicy: Cluster
# sessionAffinity: None
frontend:
type: ClusterIP
port: 80
targetPort: 8000
# nodePort: 31000
annotations: {}
# nodePort: 31000
# externalTrafficPolicy: Cluster
# sessionAffinity: None

ingress:
shard:
Expand Down

0 comments on commit fe07eca

Please sign in to comment.