Skip to content

Commit 381f9d2

Browse files
authored
operator: Add e2e local development with kind (#6339)
1 parent 167c95c commit 381f9d2

18 files changed

+7011
-17
lines changed

operator/.bingo/Variables.mk

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,24 @@ $(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod
4141
@echo "(re)installing $(GOBIN)/golangci-lint-v1.38.0"
4242
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.38.0 "github.com/golangci/golangci-lint/cmd/golangci-lint"
4343

44+
KIND := $(GOBIN)/kind-v0.11.0
45+
$(KIND): $(BINGO_DIR)/kind.mod
46+
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
47+
@echo "(re)installing $(GOBIN)/kind-v0.11.0"
48+
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=kind.mod -o=$(GOBIN)/kind-v0.11.0 "sigs.k8s.io/kind"
49+
4450
KUSTOMIZE := $(GOBIN)/kustomize-v4.2.0
4551
$(KUSTOMIZE): $(BINGO_DIR)/kustomize.mod
4652
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
4753
@echo "(re)installing $(GOBIN)/kustomize-v4.2.0"
4854
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=kustomize.mod -o=$(GOBIN)/kustomize-v4.2.0 "sigs.k8s.io/kustomize/kustomize/v4"
4955

56+
LOGCLI := $(GOBIN)/logcli-v1.6.2-0.20220407212443-2d9d0ee236ea
57+
$(LOGCLI): $(BINGO_DIR)/logcli.mod
58+
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
59+
@echo "(re)installing $(GOBIN)/logcli-v1.6.2-0.20220407212443-2d9d0ee236ea"
60+
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=logcli.mod -o=$(GOBIN)/logcli-v1.6.2-0.20220407212443-2d9d0ee236ea "github.com/grafana/loki/cmd/logcli"
61+
5062
OPERATOR_SDK := $(GOBIN)/operator-sdk-v1.19.1
5163
$(OPERATOR_SDK): $(BINGO_DIR)/operator-sdk.mod
5264
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.

operator/.bingo/kind.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
2+
3+
go 1.17
4+
5+
require sigs.k8s.io/kind v0.11.0

operator/.bingo/kind.sum

Lines changed: 417 additions & 0 deletions
Large diffs are not rendered by default.

operator/.bingo/logcli.mod

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
2+
3+
go 1.17
4+
5+
replace github.com/sercand/kuberesolver => github.com/sercand/kuberesolver v2.4.0+incompatible
6+
7+
replace github.com/hpcloud/tail => github.com/grafana/tail v0.0.0-20201004203643-7aa4e4a91f03
8+
9+
replace github.com/Azure/azure-sdk-for-go => github.com/Azure/azure-sdk-for-go v36.2.0+incompatible
10+
11+
replace github.com/Azure/azure-storage-blob-go => github.com/MasslessParticle/azure-storage-blob-go v0.14.1-0.20220216145902-b5e698eff68e
12+
13+
replace k8s.io/client-go => k8s.io/client-go v0.21.0
14+
15+
replace k8s.io/api => k8s.io/api v0.21.0
16+
17+
replace k8s.io/apimachinery => k8s.io/apimachinery v0.21.0
18+
19+
replace github.com/hashicorp/consul => github.com/hashicorp/consul v1.5.1
20+
21+
replace github.com/gocql/gocql => github.com/grafana/gocql v0.0.0-20200605141915-ba5dc39ece85
22+
23+
replace github.com/bradfitz/gomemcache => github.com/themihai/gomemcache v0.0.0-20180902122335-24332e2d58ab
24+
25+
replace github.com/thanos-io/thanos v0.22.0 => github.com/thanos-io/thanos v0.19.1-0.20211126105533-c5505f5eaa7d
26+
27+
replace gopkg.in/Graylog2/go-gelf.v2 => github.com/grafana/go-gelf v0.0.0-20211112153804-126646b86de8
28+
29+
replace github.com/cloudflare/cloudflare-go => github.com/cyriltovena/cloudflare-go v0.27.1-0.20211118103540-ff77400bcb93
30+
31+
require github.com/grafana/loki v1.6.2-0.20220407212443-2d9d0ee236ea // cmd/logcli

operator/.bingo/logcli.sum

Lines changed: 199 additions & 0 deletions
Large diffs are not rendered by default.

operator/.bingo/variables.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ GOFUMPT="${GOBIN}/gofumpt-v0.1.1"
1616

1717
GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.38.0"
1818

19+
KIND="${GOBIN}/kind-v0.11.0"
20+
1921
KUSTOMIZE="${GOBIN}/kustomize-v4.2.0"
2022

23+
LOGCLI="${GOBIN}/logcli-v1.6.2-0.20220407212443-2d9d0ee236ea"
24+
2125
OPERATOR_SDK="${GOBIN}/operator-sdk-v1.19.1"
2226

2327
PROMTOOL="${GOBIN}/promtool-v1.8.2-0.20220211202545-56e14463bccf"

operator/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,15 @@ ifndef ignore-not-found
182182
ignore-not-found = false
183183
endif
184184

185+
.PHONY: quickstart
186+
ifeq ($(or $(findstring openshift-logging,$(IMG)),$(findstring openshift-logging,$(BUNDLE_IMG))),openshift-logging)
187+
quickstart: $(KIND) ## Quickstart full dev environment on local kind cluster
188+
@./quickstart.sh $(filter-out $@,$(MAKECMDGOALS))
189+
else
190+
quickstart: oci-build oci-push $(KIND)
191+
@./quickstart.sh $(filter-out $@,$(MAKECMDGOALS))
192+
endif
193+
185194
.PHONY: run
186195
run: generate manifests ## Run against the configured Kubernetes cluster in ~/.kube/config
187196
go run ./main.go

operator/config/overlays/development/controller_manager_config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ leaderElection:
1010
leaderElect: false
1111
resourceName: e3716011.grafana.com
1212
featureFlags:
13+
enableLokiStackGateway: true
14+
enableTlsGrpcServices: true
1315
enableLokiStackWebhook: false
1416
enableAlertingRuleWebhook: false
1517
enableRecordingRuleWebhook: false

operator/config/overlays/development/minio/secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: Secret
33
metadata:
44
name: test
55
stringData:
6-
endpoint: http://minio.default.svc.cluster.local.:9000
6+
endpoint: http://minio.default.svc:9000
77
bucketnames: loki
88
access_key_id: minio
99
access_key_secret: minio123

0 commit comments

Comments
 (0)