Skip to content

Commit 397da27

Browse files
authored
fix(operator): Return quickstart script to working condition and improve rootless usage (#19960)
1 parent 129ebd6 commit 397da27

File tree

8 files changed

+11457
-3276
lines changed

8 files changed

+11457
-3276
lines changed

operator/Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,8 @@ ifndef ignore-not-found
224224
endif
225225

226226
.PHONY: quickstart
227-
ifeq ($(or $(findstring openshift-logging,$(IMG)),$(findstring openshift-logging,$(BUNDLE_IMG))),openshift-logging)
228227
quickstart: $(KIND) ## Quickstart full dev environment on local kind cluster
229228
@./quickstart.sh $(filter-out $@,$(MAKECMDGOALS))
230-
else
231-
quickstart: oci-build oci-push $(KIND)
232-
@./quickstart.sh $(filter-out $@,$(MAKECMDGOALS))
233-
endif
234229

235230
.PHONY: quickstart-cleanup
236231
quickstart-cleanup: $(KIND) ## Cleanup for quickstart set up

operator/docs/prologue/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ make quickstart
2929
If you want to test local changes from your repository fork, you need to provide an image registry organization that you own that has an image repository name `loki-operator`(e.g., `quay.io/my-company-org/loki-operator`). The command to use your custom images is:
3030

3131
```shell
32-
make quickstart REGISTRY_BASE=quay.io/my-company-org
32+
make oci-build oci-push quickstart REGISTRY_BASE=quay.io/my-company-org
3333
```
3434

3535
## Further reading

operator/hack/addons_cert_manager.yaml

Lines changed: 11410 additions & 3245 deletions
Large diffs are not rendered by default.

operator/hack/addons_logger.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ spec:
1616
- args:
1717
- generate
1818
- --destination=loki
19-
- --destination-url=http://token-refresher.default.svc.cluster.local:8080/api/logs/v1/test-oidc/loki/api/v1/push
19+
- --url=http://token-refresher.default.svc.cluster.local:8080/api/logs/v1/test-oidc/loki/api/v1/push
2020
- --tenant=test-oidc
21+
- --disable-security-check
2122
image: quay.io/openshift-logging/cluster-logging-load-client:latest
2223
imagePullPolicy: Always
2324
name: logger

operator/hack/addons_token_refresher.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ spec:
3939
- --oidc.client-id=$(OIDC_CLIENT_ID)
4040
- --oidc.client-secret=$(OIDC_CLIENT_SECRET)
4141
- --oidc.issuer-url=$(OIDC_ISSUER_URL)
42-
- --url=http://lokistack-dev-gateway-http.default.svc:8080
42+
- --url=https://lokistack-dev-gateway-http.default.svc:8080
43+
- --upstream.ca-file=/etc/certs/service-ca.crt
4344
env:
4445
- name: OIDC_AUDIENCE
4546
valueFrom:
@@ -61,13 +62,20 @@ spec:
6162
secretKeyRef:
6263
key: issuerUrl
6364
name: token-refresher-oidc
64-
image: quay.io/observatorium/token-refresher:master-2021-03-05-b34376b
65+
image: quay.io/observatorium/token-refresher:master-2024-12-11-08b888a
6566
name: token-refresher
6667
ports:
6768
- containerPort: 8081
6869
name: internal
6970
- containerPort: 8080
7071
name: web
72+
volumeMounts:
73+
- mountPath: /etc/certs
74+
name: certificates
75+
volumes:
76+
- name: certificates
77+
configMap:
78+
name: lokistack-dev-gateway-ca-bundle
7179
---
7280
apiVersion: v1
7381
kind: Service

operator/hack/addons_traefik.yaml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ rules:
5151
- apiGroups:
5252
- ""
5353
resources:
54-
- services
5554
- endpoints
55+
- nodes
5656
- secrets
57+
- services
5758
verbs:
5859
- get
5960
- list
@@ -90,6 +91,14 @@ rules:
9091
- get
9192
- list
9293
- watch
94+
- apiGroups:
95+
- discovery.k8s.io
96+
resources:
97+
- endpointslices
98+
verbs:
99+
- get
100+
- list
101+
- watch
93102
---
94103
apiVersion: rbac.authorization.k8s.io/v1
95104
kind: ClusterRoleBinding
@@ -114,6 +123,8 @@ spec:
114123
selector:
115124
matchLabels:
116125
app: traefik
126+
strategy:
127+
type: Recreate
117128
template:
118129
metadata:
119130
labels:
@@ -122,27 +133,27 @@ spec:
122133
serviceAccountName: traefik
123134
containers:
124135
- name: traefik
125-
image: traefik:v2.7.0
136+
image: traefik:v3.6.2
126137
args:
127138
- --api.insecure
128139
- --api.dashboard
129140
- --log.level=debug
130141
- --accesslog=true
131-
- --entryPoints.web.address=:80
132-
- --entryPoints.websecure.address=:443
142+
- --entryPoints.traefik.address=:8082
143+
- --entryPoints.web.address=:8081
144+
- --entryPoints.websecure.address=:8443
133145
- --providers.kubernetesIngress
134146
- --providers.file.filename=/config/config.yaml
135147
- --providers.file.watch=false
136148
ports:
137149
- name: http
138-
containerPort: 80
139-
hostPort: 80
150+
containerPort: 8081
151+
hostPort: 8081
140152
- name: https
141-
containerPort: 443
142-
hostPort: 443
153+
containerPort: 8443
143154
- name: admin
144-
containerPort: 8080
145-
hostPort: 8080
155+
containerPort: 8082
156+
hostPort: 8082
146157
securityContext:
147158
capabilities:
148159
drop:

operator/hack/kind_config.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@ nodes:
1010
kubeletExtraArgs:
1111
node-labels: "ingress-ready=true"
1212
extraPortMappings:
13-
# Ingress Controller Web Port
14-
- containerPort: 80
15-
hostPort: 80
16-
# Ingress Controller Web Secure Port
17-
- containerPort: 443
18-
hostPort: 443
19-
# Ingress Controller Admin Port
20-
- containerPort: 8080
21-
hostPort: 8080
13+
# Traefik Web Port
14+
- containerPort: 8081
15+
hostPort: 8081
16+
# Traefik Admin Port
17+
- containerPort: 8082
18+
hostPort: 8082

operator/quickstart.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ lokistack(){
4848
echo "- Deploy Loki Stack... -"
4949
echo "-------------------------------------------"
5050
kubectl apply -f ./hack/lokistack_gateway_dev.yaml
51+
52+
echo "-------------------------------------------"
53+
echo "- Wait for LokiStack (~ 90s)... -"
54+
echo "-------------------------------------------"
55+
kubectl wait --for=condition=Ready --timeout=5m lokistack/lokistack-dev
5156
}
5257

5358
logger() {
@@ -73,8 +78,7 @@ certificates() {
7378
}
7479

7580
check() {
76-
# shellcheck disable=SC2154
77-
${LOGCLI} --addr "http://localhost/token-refresher/api/logs/v1/test-oidc" labels
81+
logcli --addr "http://localhost:8081/token-refresher/api/logs/v1/test-oidc" labels
7882
}
7983

8084
case ${1:-"*"} in
@@ -112,9 +116,9 @@ help)
112116

113117
*)
114118
setup
119+
certificates
115120
deps
116121
operator
117-
certificates
118122
lokistack
119123
logger
120124
;;

0 commit comments

Comments
 (0)