Skip to content

Commit 25b0d7a

Browse files
authored
New field ExternalPort for GRPC Service to override --grpc-public-port arg (#278)
1 parent c3664d0 commit 25b0d7a

20 files changed

+280
-24
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: Added
2+
body: field externalPort for grpc service to override --grpc-public-port arg
3+
time: 2025-01-04T14:34:52.706824+08:00
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: Fixed
2+
body: update the Makefile with the changes in GitHub CI
3+
time: 2025-01-04T14:37:47.689565+08:00

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ com_crashlytics_export_strings.xml
1414
crashlytics.properties
1515
crashlytics-build.properties
1616
fabric.properties
17+
log.json
18+
log.txt
1719

1820
bin/
1921
config/

Makefile

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ VERSION ?= 0.1.0
99
IMG ?= cr.yandex/yc/ydb-operator:latest
1010
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
1111
ENVTEST_K8S_VERSION = 1.26
12+
# Image URL which uses in tests
13+
YDB_IMAGE ?= $(shell grep "anchor_for_fetching_image_from_workflow" ./tests/**/*.go | grep -o -E '"cr\.yandex.*"' | tr -d '"')
1214

1315
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
1416
ifeq (,$(shell go env GOBIN))
@@ -65,25 +67,29 @@ vet: ## Run go vet against code.
6567

6668
kind-init:
6769
if kind get clusters | grep "kind-ydb-operator"; then exit 0; fi; \
68-
kind create cluster --config e2e/kind-cluster-config.yaml --name kind-ydb-operator; \
69-
docker pull k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0; \
70-
kind load docker-image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0 --name kind-ydb-operator; \
71-
docker pull cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7; \
72-
kind load docker-image cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7 --name kind-ydb-operator
70+
kind create cluster \
71+
--config tests/cfg/kind-cluster-config.yaml \
72+
--image=kindest/node:v1.31.2@sha256:18fbefc20a7113353c7b75b5c869d7145a6abd6269154825872dc59c1329912e \
73+
--name kind-ydb-operator
74+
docker pull k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0
75+
kind load docker-image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0 --name kind-ydb-operator
76+
docker pull ${YDB_IMAGE}
77+
kind load docker-image ${YDB_IMAGE} --name kind-ydb-operator
7378

7479
kind-load:
75-
docker tag cr.yandex/yc/ydb-operator:latest kind/ydb-operator:current
80+
docker tag ${IMG} kind/ydb-operator:current
7681
kind load docker-image kind/ydb-operator:current --name kind-ydb-operator
7782

7883
opts ?= ''
7984

8085
.PHONY: unit-test
8186
unit-test: manifests generate fmt vet envtest ## Run unit tests
82-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use --arch=amd64 $(ENVTEST_K8S_VERSION) -p path)" go test -v -timeout 900s -p 1 ./internal/... -ginkgo.v -coverprofile cover.out $(opts)
87+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use --arch=amd64 $(ENVTEST_K8S_VERSION) -p path)" \
88+
go test -v -timeout 900s -p 1 ./internal/... -ginkgo.vv -coverprofile cover.out $(opts)
8389

8490
.PHONY: e2e-test
8591
e2e-test: manifests generate fmt vet docker-build kind-init kind-load ## Run e2e tests
86-
go test -v -timeout 3600s -p 1 ./e2e/... -ginkgo.v $(opts)
92+
go test -v -timeout 3600s -p 1 ./tests/e2e/... -ginkgo.vv $(opts)
8793

8894
.PHONY: test
8995
test: unit-test e2e-test ## Run all tests

api/v1alpha1/const.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const (
6464
AnnotationDisableLivenessProbe = "ydb.tech/disable-liveness-probe"
6565
AnnotationDataCenter = "ydb.tech/data-center"
6666
AnnotationGRPCPublicHost = "ydb.tech/grpc-public-host"
67+
AnnotationGRPCPublicPort = "ydb.tech/grpc-public-port"
6768
AnnotationNodeHost = "ydb.tech/node-host"
6869
AnnotationNodeDomain = "ydb.tech/node-domain"
6970
AnnotationAuthTokenSecretName = "ydb.tech/auth-token-secret-name"

api/v1alpha1/service_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ type GRPCService struct {
2121
Service `json:""`
2222

2323
TLSConfiguration *TLSConfiguration `json:"tls,omitempty"`
24-
ExternalHost string `json:"externalHost,omitempty"` // TODO implementation
24+
ExternalHost string `json:"externalHost,omitempty"`
25+
ExternalPort int32 `json:"externalPort,omitempty"`
2526
IPDiscovery *IPDiscovery `json:"ipDiscovery,omitempty"`
2627
}
2728

deploy/ydb-operator/crds/database.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4075,6 +4075,9 @@ spec:
40754075
type: object
40764076
externalHost:
40774077
type: string
4078+
externalPort:
4079+
format: int32
4080+
type: integer
40784081
ipDiscovery:
40794082
properties:
40804083
enabled:

deploy/ydb-operator/crds/databasenodeset.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2687,6 +2687,9 @@ spec:
26872687
type: object
26882688
externalHost:
26892689
type: string
2690+
externalPort:
2691+
format: int32
2692+
type: integer
26902693
ipDiscovery:
26912694
properties:
26922695
enabled:

deploy/ydb-operator/crds/remotedatabasenodeset.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2688,6 +2688,9 @@ spec:
26882688
type: object
26892689
externalHost:
26902690
type: string
2691+
externalPort:
2692+
format: int32
2693+
type: integer
26912694
ipDiscovery:
26922695
properties:
26932696
enabled:

deploy/ydb-operator/crds/remotestoragenodeset.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2715,6 +2715,9 @@ spec:
27152715
type: object
27162716
externalHost:
27172717
type: string
2718+
externalPort:
2719+
format: int32
2720+
type: integer
27182721
ipDiscovery:
27192722
properties:
27202723
enabled:

0 commit comments

Comments
 (0)