Skip to content

Commit

Permalink
Allow changing of grpc and http ports from single placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
prafull01 committed Sep 23, 2024
1 parent 950a699 commit b63d0ea
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
10 changes: 6 additions & 4 deletions build/templates/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ conf:
# If non-empty, create a SQL audit log in the specified directory.
sql-audit-dir: ""

# CockroachDB's port to listen to inter-communications and client connections.
port: 26257
# WARNING this parameter is deprecated and will be removed in a future version. Use `.service.ports.grpc.internal.port` instead
port: ""

# CockroachDB's port to listen to HTTP requests.
http-port: 8080
# WARNING this parameter is deprecated and will be removed in a future version. Use `.service.ports.http.port` instead
http-port: ""

# CockroachDB's data mount path.
path: cockroach-data
Expand Down Expand Up @@ -293,10 +293,12 @@ service:
# If the port number is different than `external.port`, then it will be
# named as `internal.name` in Service.
internal:
# CockroachDB's port to listen to inter-communications and client connections.
port: 26257
# If using Istio set it to `cockroach`.
name: grpc-internal
http:
# CockroachDB's port to listen to HTTP requests.
port: 8080
name: http

Expand Down
16 changes: 16 additions & 0 deletions cockroachdb/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,16 @@ spec:
{{- with .Values.conf.attrs }}
--attrs={{ join `:` . }}
{{- end }}
{{- if index .Values.conf `http-port` }}
--http-port={{ index .Values.conf `http-port` | int64 }}
{{- else }}
--http-port={{ index .Values.service.ports.http.port | int64 }}
{{- end }}
{{ if .Values.conf.port }}
--port={{ .Values.conf.port | int64 }}
{{- else }}
--port={{ .Values.service.ports.grpc.internal.port | int64 }}
{{- end }}
--cache={{ .Values.conf.cache }}
{{- with index .Values.conf `max-disk-temp-storage` }}
--max-disk-temp-storage={{ . }}
Expand Down Expand Up @@ -241,10 +249,18 @@ spec:
{{- end }}
ports:
- name: grpc
{{ if .Values.conf.port }}
containerPort: {{ .Values.conf.port | int64 }}
{{- else }}
containerPort: {{ .Values.service.ports.grpc.internal.port | int64 }}
{{- end }}
protocol: TCP
- name: http
{{- if index .Values.conf `http-port` }}
containerPort: {{ index .Values.conf `http-port` | int64 }}
{{- else }}
containerPort: {{ index .Values.service.ports.http.port | int64 }}
{{- end }}
protocol: TCP
volumeMounts:
- name: datadir
Expand Down
10 changes: 6 additions & 4 deletions cockroachdb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ conf:
# If non-empty, create a SQL audit log in the specified directory.
sql-audit-dir: ""

# CockroachDB's port to listen to inter-communications and client connections.
port: 26257
# WARNING this parameter is deprecated and will be removed in a future version. Use `.service.ports.grpc.internal.port` instead
port: ""

# CockroachDB's port to listen to HTTP requests.
http-port: 8080
# WARNING this parameter is deprecated and will be removed in a future version. Use `.service.ports.http.port` instead
http-port: ""

# CockroachDB's data mount path.
path: cockroach-data
Expand Down Expand Up @@ -294,10 +294,12 @@ service:
# If the port number is different than `external.port`, then it will be
# named as `internal.name` in Service.
internal:
# CockroachDB's port to listen to inter-communications and client connections.
port: 26257
# If using Istio set it to `cockroach`.
name: grpc-internal
http:
# CockroachDB's port to listen to HTTP requests.
port: 8080
name: http

Expand Down

0 comments on commit b63d0ea

Please sign in to comment.