Skip to content

Commit 54bafd5

Browse files
committed
Update different configs to better dev experience
1 parent f5d4a0f commit 54bafd5

6 files changed

Lines changed: 27 additions & 15 deletions

File tree

Makefile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ VERSION ?= $(shell git describe --tags --always --dirty="-dev")
33
IMG ?= quay.io/lwolf/konsumerator:$(VERSION)
44
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
55
CRD_OPTIONS ?= "crd:trivialVersions=true"
6+
KUBECTL ?= "kubectl"
67

78
# for some reason travis-ci calls `make` on each step which triggers download
89
# of all packages. This check disables it.
@@ -29,12 +30,12 @@ run: generate fmt vet
2930

3031
# Install CRDs into a cluster
3132
install: manifests
32-
kubectl apply -f config/crd/bases
33+
${KUBECTL} apply -f config/crd/bases
3334

3435
# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
3536
deploy: manifests
36-
kubectl apply -f config/crd/bases
37-
kustomize build config/default | kubectl apply -f -
37+
#$(KUBECTL) apply -f config/crd/bases
38+
kustomize build config/default | $(KUBECTL) apply -f -
3839

3940
# Generate manifests e.g. CRD, RBAC etc.
4041
manifests: bin/controller-gen
@@ -82,8 +83,8 @@ kind-load-image:
8283
kind-update: docker-build kind-load-image deploy
8384

8485
kind-apply:
85-
kubectl --context=kind-konsumerator apply -f ./hack/ci/prom.yaml -n kube-system
86-
kubectl --context=kind-konsumerator apply -f ./hack/ci/konsumerator-dashboard.yaml -n kube-system
87-
kubectl --context=kind-konsumerator apply -f ./hack/ci/konsumerator-overview-dashboard.yaml -n kube-system
88-
kubectl --context=kind-konsumerator apply -f ./hack/ci/grafana.yaml -n kube-system
86+
$(KUBECTL) --context=kind-konsumerator apply -f ./hack/ci/prom.yaml -n kube-system
87+
$(KUBECTL) --context=kind-konsumerator apply -f ./hack/ci/konsumerator-dashboard.yaml -n kube-system
88+
$(KUBECTL) --context=kind-konsumerator apply -f ./hack/ci/konsumerator-overview-dashboard.yaml -n kube-system
89+
$(KUBECTL) --context=kind-konsumerator apply -f ./hack/ci/grafana.yaml -n kube-system
8990

config/manager/manager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ spec:
2525
containers:
2626
- name: manager
2727
args:
28-
- --enable-leader-election
28+
- --namespace=konsumerator-system
2929
image: controller:latest
3030
resources:
3131
limits:

config/rbac/leader_election_role.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ rules:
1616
- update
1717
- patch
1818
- delete
19+
- apiGroups:
20+
- coordination.k8s.io
21+
resources:
22+
- leases
23+
verbs:
24+
- get
25+
- list
26+
- watch
27+
- create
28+
- update
29+
- patch
30+
- delete
1931
- apiGroups:
2032
- ""
2133
resources:

controllers/utils.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ func UpdateStatusAnnotations(cm *corev1.ConfigMap, status *konsumeratorv1.Consum
126126
cm.Annotations[annotationStatusLagging] = fmt.Sprintf("%d", *status.Lagging)
127127
cm.Annotations[annotationStatusMissing] = fmt.Sprintf("%d", *status.Missing)
128128
cm.Annotations[annotationStatusOutdated] = fmt.Sprintf("%d", *status.Outdated)
129-
cm.Annotations[annotationStatusLastSyncTime] = status.LastSyncTime.Format(helpers.TimeLayout)
129+
if !status.LastSyncTime.IsZero() {
130+
cm.Annotations[annotationStatusLastSyncTime] = status.LastSyncTime.Format(helpers.TimeLayout)
131+
}
130132
state, err := json.Marshal(status.LastSyncState)
131133
if err != nil {
132134
return err

hack/ci/consumer-test-configmap.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ data:
88
consumer.yaml: |
99
numPartitions: 10
1010
name: "test-consumer"
11-
namespace: "consumer-test"
11+
namespace: "konsumerator-system"
1212
autoscaler:
1313
# mode could be vpa or prometheus.
1414
# `prometheus` is configured using prometheus provider and user specific metrics
@@ -35,7 +35,7 @@ data:
3535
recoveryTime: "30m"
3636
# prometheus addresses to query
3737
address:
38-
- "http://172.17.0.3:30666"
38+
- "http://prometheus-server.kube-system:9090"
3939
# Offset query should return number of messages that is not
4040
# processed yet a.k.a lag per partitionLabel
4141
offset:

hack/ci/consumer-test.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ spec:
66
numPartitions: 2
77
numPartitionsPerInstance: 2
88
name: "test-consumer"
9-
namespace: "default"
9+
namespace: "konsumerator-system"
1010
autoscaler:
1111
# mode could be vpa or prometheus.
1212
# `prometheus` is configured using prometheus provider and user specific metrics
@@ -34,8 +34,6 @@ spec:
3434
# prometheus addresses to query
3535
address:
3636
- "http://prometheus-server.kube-system:9090"
37-
- "http://172.17.0.1:30666"
38-
- "http://172.17.0.3:30666"
3937
# Offset query should return number of messages that is not
4038
# processed yet a.k.a lag per partitionLabel
4139
offset:
@@ -108,7 +106,6 @@ spec:
108106
cpu: "1"
109107
memory: "100M"
110108
- containerName: busybox-info
111-
# mode: Off
112109
minAllowed:
113110
cpu: "100m"
114111
memory: "100M"

0 commit comments

Comments
 (0)