Skip to content

Commit cee35d2

Browse files
Resolve: PR reviews
Fix: e2e test cases Fix: e2e test cases
1 parent f68a938 commit cee35d2

17 files changed

+156
-106
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ test/cluster/down: bin/k3d
112112

113113
test/e2e/%: PKG=$*
114114
test/e2e/%: bin/cockroach bin/kubectl bin/helm build/self-signer test/cluster ## run e2e tests for package (e.g. install or rotate)
115-
@PATH="$(PWD)/bin:${PATH}" go test -timeout 30m -v ./tests/e2e/... || EXIT_CODE=$$?; \
115+
@PATH="$(PWD)/bin:${PATH}" go test -timeout 30m -v ./tests/e2e/${PKG}/... || EXIT_CODE=$$?; \
116116
$(MAKE) test/cluster/down; \
117117
exit $${EXIT_CODE:-0}
118118

build/templates/values.yaml

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -712,11 +712,11 @@ iap:
712712
# clientSecret:
713713

714714
# Set the GODEBUG env var for the Go runtime. By default, disable Transparent Huge Pages,
715-
# which cause memory inefficiency for CRDB.
715+
# which cause memory inefficiency for CockroachDB.
716716
godebug:
717717
disablethp: "1"
718718

719-
# Use the CRDB Operator to manage the CRDB clusters
719+
# Use the CockroachDB Operator to manage the CockroachDB clusters.
720720
operator:
721721
enabled: true
722722
# Default values for the cluster chart.
@@ -729,11 +729,11 @@ operator:
729729
nameOverride: ""
730730
fullnameOverride: ""
731731

732-
# A map of CRDB cluster settings.
732+
# A map of CockroachDB cluster settings.
733733
# See https://www.cockroachlabs.com/docs/stable/cluster-settings.html
734734
clusterSettings: ~
735735

736-
# Regions controls the number of CRDB nodes that are deployed per region.
736+
# Regions controls the number of CockroachDB nodes that are deployed per region.
737737
# regions: ~
738738
# - code: us-central1
739739
# nodes: 3
@@ -758,7 +758,7 @@ operator:
758758
# cpu: 100m
759759
# memory: 128Mi
760760

761-
# dataStore specifies the disk configuration for the CRDB Node.
761+
# dataStore specifies the disk configuration for the CockroachDB Node.
762762
dataStore:
763763
volumeClaimTemplate:
764764
metadata: {}
@@ -779,7 +779,7 @@ operator:
779779
# the number of days generated certs are valid for
780780
# validForDays: 3650
781781

782-
# External certificates for the CRDB cluster.
782+
# External certificates for the CockroachDB cluster.
783783
externalCertificates:
784784
clientCaConfigMapName: ""
785785
nodeCaConfigMapName: ""
@@ -788,7 +788,7 @@ operator:
788788
nodeSecretName: ""
789789
rootSqlClientSecretName: ""
790790

791-
# RBAC settings for CRDB nodes
791+
# RBAC settings for CockroachDB nodes
792792
rbac:
793793
# By default the service account will be the resource name. It will
794794
# be created during the installation along with a namespaced role and
@@ -822,29 +822,56 @@ operator:
822822
cloudProvider: k3d
823823
namespace: default
824824

825-
# PodLabels are the labels that should be applied to the underlying CRDB pod
825+
# PodLabels are the labels that should be applied to the underlying CockroachDB pod
826826
podLabels:
827827
app.kubernetes.io/component: cockroachdb
828828

829-
# Flags passed to the cockroachdb container.
829+
# Flags passed to the CockroachDB container.
830830
flags:
831831
# Disable backup/restore to local disk by default.
832832
--external-io-dir: disabled
833833

834-
# Environment variables set on cockroachdb pods.
834+
# Environment variables set on CockroachDB pods.
835835
env: []
836836

837-
# Delay between cockroachdb pod restarts. Wait 3m by default to avoid
837+
# Delay between CockroachDB pod restarts. Wait 3m by default to avoid
838838
# unavailability during restarts.
839839
rollingRestartDelay: 3m0s
840840

841-
# Topology spread constraints set on cockroachdb pods. Spread cockroachdb
841+
# Topology spread constraints set on CockroachDB pods. Spread CockroachDB
842842
# pods across zones by default.
843843
topologySpreadConstraints:
844844
- maxSkew: 1
845845
topologyKey: topology.kubernetes.io/zone
846846
whenUnsatisfiable: DoNotSchedule
847847

848+
# Service Ports for configuring non-standard ports
849+
# for grpc, sql, http services.
850+
service:
851+
ports:
852+
# You can set a different external and internal gRPC ports and their name.
853+
grpc:
854+
external:
855+
port: 26258
856+
name: grpc
857+
# If the port number is different than `external.port`, then it will be
858+
# named as `internal.name` in Service.
859+
internal:
860+
# CockroachDB's port to listen to inter-communications and client connections.
861+
port: 26257
862+
# If using Istio set it to `cockroach`.
863+
name: grpc-internal
864+
http:
865+
# CockroachDB's port to listen to HTTP requests.
866+
port: 8080
867+
name: http
868+
869+
# This Service is meant to be used by clients of the database.
870+
# It exposes a ClusterIP that will automatically load balance connections
871+
# to the different database Pods.
872+
public:
873+
type: ClusterIP
874+
848875
extras:
849876
# Add a container with dnsutils (nslookup, dig, ping, etc.) installed.
850877
dnsutils: false

cockroachdb/templates/_helpers.tpl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,6 @@ Construct the GODEBUG env var value (looks like: GODEBUG="foo=bar,baz=quux"; def
362362
{{- join "," $godebugList -}}
363363
{{- end }}
364364

365-
366365
{{/* Common labels that are applied to all managed objects. */}}
367366
{{- define "cluster.labels" -}}
368367
helm.sh/chart: {{ include "cockroachdb.chart" . }}
@@ -375,7 +374,7 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
375374

376375
{{/*
377376
Selector labels defines the set of labels that can be used as selectors for
378-
crdb nodes.
377+
CockroachDB nodes.
379378
*/}}
380379
{{- define "cluster.selectorLabels" -}}
381380
app.kubernetes.io/name: {{ include "cockroachdb.clusterfullname" . }}

cockroachdb/templates/crdb.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,14 @@ spec:
6161
{{- if .Values.operator.loggingConf }}
6262
loggingConfigMapName: {{ .Release.Name }}-logging
6363
{{- end }}
64-
# All properties below are solely to pass validation. They aren't used by the
65-
# betaclusterctrl controller so the values don't matter so long as they're
66-
# valid.
64+
{{- if .Values.operator.service.ports.grpc.external.port }}
65+
gRPCPort: {{ .Values.operator.service.ports.grpc.external.port }}
66+
{{- end }}
67+
{{- if .Values.operator.service.ports.grpc.internal.port }}
68+
sQLPort: {{ .Values.operator.service.ports.grpc.internal.port }}
69+
{{- end }}
70+
{{- if .Values.operator.service.ports.http.port }}
71+
hTTPPort: {{ .Values.operator.service.ports.http.port }}
72+
{{- end }}
6773
dataStore: {}
6874
{{- end }}

cockroachdb/templates/job-certSelfSigner.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
# job is considered part of the release.
1010
"helm.sh/hook": pre-install,pre-upgrade
1111
"helm.sh/hook-weight": "4"
12-
"helm.sh/hook-delete-policy": hook-succeeded,hook-failed
12+
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
1313
labels:
1414
helm.sh/chart: {{ template "cockroachdb.chart" . }}
1515
app.kubernetes.io/name: {{ template "cockroachdb.name" . }}

cockroachdb/templates/job-cleaner.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ metadata:
88
# This is what defines this resource as a hook. Without this line, the
99
# job is considered part of the release.
1010
"helm.sh/hook": pre-delete
11-
"helm.sh/hook-delete-policy": hook-succeeded,hook-failed
11+
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
1212
labels:
1313
helm.sh/chart: {{ template "cockroachdb.chart" . }}
1414
app.kubernetes.io/name: {{ template "cockroachdb.name" . }}

cockroachdb/templates/role-certSelfSigner.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
# job is considered part of the release.
1010
"helm.sh/hook": pre-install,pre-upgrade
1111
"helm.sh/hook-weight": "2"
12-
"helm.sh/hook-delete-policy": hook-succeeded,hook-failed
12+
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
1313
labels:
1414
helm.sh/chart: {{ template "cockroachdb.chart" . }}
1515
app.kubernetes.io/name: {{ template "cockroachdb.name" . }}

cockroachdb/templates/rolebinding-certSelfSigner.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
# job is considered part of the release.
1010
"helm.sh/hook": pre-install,pre-upgrade
1111
"helm.sh/hook-weight": "3"
12-
"helm.sh/hook-delete-policy": hook-succeeded,hook-failed
12+
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
1313
labels:
1414
helm.sh/chart: {{ template "cockroachdb.chart" . }}
1515
app.kubernetes.io/name: {{ template "cockroachdb.name" . }}

cockroachdb/templates/service.public.yaml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,23 @@ spec:
3939
{{- end }}
4040
# Cockroach Cloud operator doesn't provide a way to change the sql,grpc and http ports for the pods. Hence, making these
4141
# ports static here.
42-
type: ClusterIP
42+
type: {{ .Values.operator.service.public.type | quote }}
4343
ports:
44-
- name: sql
45-
port: 26257
46-
protocol: TCP
47-
targetPort: 26257
48-
- name: grpc
49-
port: 26258
50-
protocol: TCP
51-
targetPort: 26258
52-
- name: http
53-
port: 8080
54-
protocol: TCP
55-
targetPort: 8080
44+
{{- $ports := .Values.operator.service.ports }}
45+
# The main port, served by gRPC, serves Postgres-flavor SQL, inter-node
46+
# traffic and the CLI.
47+
- name: {{ $ports.grpc.external.name | quote }}
48+
port: {{ $ports.grpc.external.port | int64 }}
49+
targetPort: grpc
50+
{{- if ne ($ports.grpc.internal.port | int64) ($ports.grpc.external.port | int64) }}
51+
- name: {{ $ports.grpc.internal.name | quote }}
52+
port: {{ $ports.grpc.internal.port | int64 }}
53+
targetPort: grpc
54+
{{- end }}
55+
# The secondary port serves the UI as well as health and debug endpoints.
56+
- name: {{ $ports.http.name | quote }}
57+
port: {{ $ports.http.port | int64 }}
58+
targetPort: http
5659
{{- else }}
5760
{{- with .Values.statefulset.labels }}
5861
{{- toYaml . | nindent 4 }}

cockroachdb/templates/serviceaccount-certSelfSigner.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ metadata:
1010
# job is considered part of the release.
1111
"helm.sh/hook": pre-install,pre-upgrade
1212
"helm.sh/hook-weight": "1"
13-
"helm.sh/hook-delete-policy": hook-succeeded,hook-failed
13+
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
1414
{{- with .Values.tls.certs.selfSigner.svcAccountAnnotations }}
1515
{{- toYaml . | nindent 4 }}
1616
{{- end }}

0 commit comments

Comments
 (0)