Skip to content

Commit ca8f70b

Browse files
authored
Remove janitor component (#312)
* Remove janitor component With the new version of parca, database files are structured differently and we can't apply the janitor's naive logic for implementing retention for parca data anymore. The component is dropped accordingly. * Don't deploy profiling setup by default
1 parent 012d1f4 commit ca8f70b

7 files changed

Lines changed: 44 additions & 196 deletions

File tree

.github/workflows/images.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ jobs:
3636
entrypoints=(
3737
./cmd/sharder
3838
./cmd/shard
39-
./hack/cmd/janitor
4039
./webhosting-operator/cmd/experiment
4140
./webhosting-operator/cmd/webhosting-operator
4241
)

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ TAG ?= latest
55
GHCR_REPO ?= ghcr.io/timebertt/kubernetes-controller-sharding
66
SHARDER_IMG ?= $(GHCR_REPO)/sharder:$(TAG)
77
SHARD_IMG ?= $(GHCR_REPO)/shard:$(TAG)
8-
JANITOR_IMG ?= $(GHCR_REPO)/janitor:$(TAG)
98
WEBHOSTING_OPERATOR_IMG ?= $(GHCR_REPO)/webhosting-operator:$(TAG)
109
EXPERIMENT_IMG ?= $(GHCR_REPO)/experiment:$(TAG)
1110

@@ -151,7 +150,7 @@ images: export KO_DOCKER_REPO = $(GHCR_REPO)
151150
.PHONY: images
152151
images: $(KO) ## Build and push container images using ko.
153152
$(KO) build --push=$(PUSH) --sbom none --base-import-paths -t $(TAG) --platform linux/amd64,linux/arm64 \
154-
./cmd/sharder ./cmd/shard ./hack/cmd/janitor ./webhosting-operator/cmd/webhosting-operator
153+
./cmd/sharder ./cmd/shard ./webhosting-operator/cmd/webhosting-operator
155154

156155
##@ Deployment
157156

@@ -178,7 +177,7 @@ up dev: export SKAFFOLD_TAIL ?= true
178177

179178
.PHONY: deploy
180179
deploy: $(SKAFFOLD) $(KUBECTL) $(YQ) ## Build all images and deploy everything to K8s cluster specified in $KUBECONFIG.
181-
$(SKAFFOLD) deploy -i $(SHARDER_IMG) -i $(SHARD_IMG) -i $(JANITOR_IMG) -i $(WEBHOSTING_OPERATOR_IMG) -i $(EXPERIMENT_IMG)
180+
$(SKAFFOLD) deploy -i $(SHARDER_IMG) -i $(SHARD_IMG) -i $(WEBHOSTING_OPERATOR_IMG) -i $(EXPERIMENT_IMG)
182181

183182
.PHONY: up
184183
up: $(SKAFFOLD) $(KUBECTL) $(YQ) ## Build all images, deploy everything to K8s cluster specified in $KUBECONFIG, start port-forward and tail logs.

docs/development.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ NAME TYPE DATA AGE CLUSTERRING-50D858E0-EXAMPLE
128128
secret/dummy-foo Opaque 0 3s shard-5fc87c9fb7-kfb2z
129129
```
130130

131-
## Monitoring and Continuous Profiling
131+
## Monitoring
132132

133-
When using the skaffold-based setup, you also get a full monitoring and continuous profiling setup for observing and analyzing the components' resource usage.
133+
When using the skaffold-based setup, you also get a full monitoring setup for observing and analyzing the components' resource usage.
134134

135135
To access the monitoring dashboards and metrics in Grafana, simply forward its port and open http://localhost:3000/ in your browser:
136136

@@ -142,10 +142,26 @@ The password for Grafana's `admin` user is written to `hack/config/monitoring/de
142142

143143
Be sure to check out the controller-runtime dashboard: http://localhost:3000/d/PuCBL3zVz/controller-runtime-controllers
144144

145+
## Continuous Profiling
146+
147+
To dig deeper into the components' resource usage, you can deploy the continuous profiling setup based on [Parca](https://parca.dev/):
148+
149+
```bash
150+
make up SKAFFOLD_MODULE=profiling SKAFFOLD_PROFILE=profiling
151+
```
152+
145153
To access the profiling data in Parca, simply forward its port and open http://localhost:7070/ in your browser:
146154

147155
```bash
148156
kubectl -n parca port-forward svc/parca 7070 &
149157
```
150158

151159
For accessing Parca through its `Ingress`, use the basic auth password for the `parca` user from `hack/config/profiling/parca_password.secret.txt`.
160+
161+
Note that the Parca deployment doesn't implement retention for profiling data.
162+
I.e., the Parca data volume will grow infinitely as long as Parca is running.
163+
To shut down Parca after analyzing the collected profiles and destroying the persistent volume use the following command:
164+
165+
```bash
166+
make down SKAFFOLD_MODULE=profiling SKAFFOLD_PROFILE=profiling
167+
```

hack/cmd/janitor/main.go

Lines changed: 0 additions & 98 deletions
This file was deleted.

hack/config/profiling/janitor_cronjob.yaml

Lines changed: 0 additions & 51 deletions
This file was deleted.

hack/config/profiling/kustomization.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ resources:
88
# grant parca running in namespace "parca" permissions required for service discovery in namespace
99
# "sharding-system" and scrape the pprof endpoints of sharder
1010
- rbac_sharder.yaml
11-
- janitor_cronjob.yaml
12-
13-
images:
14-
- name: janitor
15-
newName: ghcr.io/timebertt/kubernetes-controller-sharding/janitor
16-
newTag: latest
1711

1812
generatorOptions:
1913
disableNameSuffixHash: true

hack/config/skaffold.yaml

Lines changed: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -282,41 +282,30 @@ apiVersion: skaffold/v4beta10
282282
kind: Config
283283
metadata:
284284
name: profiling
285-
build:
286-
artifacts:
287-
- image: ghcr.io/timebertt/kubernetes-controller-sharding/janitor
288-
ko:
289-
dependencies:
290-
paths:
291-
- go.mod
292-
- ./hack/cmd/janitor/**/*.go
293-
main: ./hack/cmd/janitor
294-
tagPolicy:
295-
inputDigest: {}
296-
local:
297-
concurrency: 0
298-
manifests:
299-
kustomize:
300-
paths:
301-
- hack/config/profiling
302-
hooks:
303-
before:
304-
- host:
305-
command:
306-
- hack/config/profiling/ensure-admin-password.sh
307-
deploy:
308-
kubectl:
309-
flags:
310-
apply:
311-
- --server-side
312-
- --force-conflicts
313-
defaultNamespace: ""
314-
portForward:
315-
- resourceType: service
316-
resourceName: parca
317-
namespace: parca
318-
port: http
319-
localPort: 7071
285+
profiles:
286+
- name: profiling
287+
manifests:
288+
kustomize:
289+
paths:
290+
- hack/config/profiling
291+
hooks:
292+
before:
293+
- host:
294+
command:
295+
- hack/config/profiling/ensure-admin-password.sh
296+
deploy:
297+
kubectl:
298+
flags:
299+
apply:
300+
- --server-side
301+
- --force-conflicts
302+
defaultNamespace: ""
303+
portForward:
304+
- resourceType: service
305+
resourceName: parca
306+
namespace: parca
307+
port: http
308+
localPort: 7071
320309
---
321310
apiVersion: skaffold/v4beta10
322311
kind: Config

0 commit comments

Comments
 (0)