Skip to content

Commit da9fdd7

Browse files
authored
typo in dev makefile (#166)
Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com>
1 parent 814db6b commit da9fdd7

File tree

11 files changed

+60
-57
lines changed

11 files changed

+60
-57
lines changed

dev.Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ demo-podinfo: ## setup ./examples/metric-pull
7070
./examples/metric-pull/setup.sh
7171

7272
.PHONY: demo-podinfo-dev
73-
demo-podinfo: ## setup ./examples/metric-pull
73+
demo-podinfo-dev: ## setup ./examples/metric-pull
7474
SETUP_ONLY=true ./examples/metric-pull/setup.sh
7575
$(MAKE) -f dev.Makefile dev-k3d
7676
@$(call say,Done)
77-
@echo "Continue with: (hey -n 7000 -z 180s http://localhost:8181/delay/2 &> /dev/null)&"
77+
@echo "Continue with: (hey -z 180s http://localhost:8181/delay/2 &> /dev/null)&"
7878

7979
.PHONY: demo-podinfo-tls
8080
demo-podinfo-tls: ## setup ./examples/metric-pull with TLS
@@ -84,7 +84,7 @@ demo-podinfo-tls: ## setup ./examples/metric-pull with TLS
8484
$(MAKE) -f dev.Makefile dev-k3d
8585
kubectl apply -f ./examples/metric-pull/podinfo-so.yaml
8686
@$(call say,Done)
87-
@echo "Continue with: (hey -n 7000 -z 180s http://localhost:8181/delay/2 &> /dev/null)&"
87+
@echo "Continue with: (hey -z 180s http://localhost:8181/delay/2 &> /dev/null)&"
8888

8989
.PHONY: demo-otel-upstream
9090
demo-otel-upstream: ## setup ./examples/metric-push

e2e-tests/operator_test.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var _ = BeforeEach(func() {
2828
getClients()
2929
})
3030

31-
var _ = Describe("Helm chart (op):", func() {
31+
var _ = Describe("Helm chart (op):", Ordered, func() {
3232
BeforeEach(func() {
3333
if only != "" && only != suiteOp {
3434
Skip("Skipping OTel operator tests")
@@ -110,7 +110,7 @@ var _ = Describe("Helm chart (op):", func() {
110110
It("should eventually scale the otel-operator from 1 -> 3", func() {
111111
time.Sleep(1 * time.Second)
112112
ctx.t.Logf(" ->>> Waiting for KEDA to scale the podinfo deployement <<<-\n\n")
113-
ctx5min, _ := context.WithTimeout(context.TODO(), 5*time.Minute)
113+
ctx15min, _ := context.WithTimeout(context.TODO(), 15*time.Minute)
114114
Eventually(func(g Gomega) {
115115
out, err := kubectl("get hpa -nkeda keda-hpa-github-metrics -ojsonpath='{.status.desiredReplicas}'")
116116
g.Expect(err).Should(Not(HaveOccurred()))
@@ -120,7 +120,7 @@ var _ = Describe("Helm chart (op):", func() {
120120
ctx.t.Logf("\n ->>> otel operator successfuly scaled to %d <<<-\n\n", desiredReplicas)
121121
GinkgoWriter.Println(" ->>> otel operator successfuly scaled to")
122122
}).WithPolling(3 * time.Second).
123-
WithContext(ctx5min).
123+
WithContext(ctx15min).
124124
Should(Succeed())
125125
})
126126
})
@@ -135,8 +135,10 @@ var _ = ReportAfterSuite("ReportAfterSuite", func(report Report) {
135135
if !report.SuiteSucceeded {
136136
ctx.t.Log("Test suite failed, leaving k3d cluster alive for inspection..")
137137
if printLogs == "true" {
138-
wrapInSection("HPA", "get -nkeda hpa keda-hpa-github-metrics -oyaml")
139-
wrapInSection("SO", "get -nkeda so github-metrics -oyaml")
138+
wrapInSection("HPA brief", "get hpa -A")
139+
wrapInSection("HPA full", "get hpa -A -oyaml")
140+
wrapInSection("SO brief", "get so -A")
141+
wrapInSection("SO full", "get so -A -oyaml")
140142
wrapInSection("PODS", "get pods -A")
141143
for _, nameAndNs := range []string{
142144
"podinfo -ndefault",

e2e-tests/podinfo_test.go

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ var _ = BeforeEach(func() {
6161
getClients()
6262
})
6363

64-
var _ = Describe("Helm chart:", func() {
64+
var _ = Describe("Helm chart:", Ordered, func() {
6565
BeforeEach(func() {
6666
if only != "" && only != suitePi {
6767
Skip("Skipping podinfo")
@@ -89,9 +89,9 @@ var _ = Describe("Helm chart:", func() {
8989
It("keda-otel-scaler should be possible to install", func() {
9090
pwd, err := os.Getwd()
9191
Expect(err).NotTo(HaveOccurred())
92-
_, err = execCmdOE("helm dependency build", pwd+"/../helmchart/otel-add-on")
92+
_, err = execCmdOE(ctx.helm+" dependency build", pwd+"/../helmchart/otel-add-on")
9393
Expect(err).NotTo(HaveOccurred())
94-
cmd := "helm upgrade -i keda-otel-scaler ../helmchart/otel-add-on --namespace keda --create-namespace -f ./testdata/scaler-values.yaml"
94+
cmd := ctx.helm + " upgrade -i keda-otel-scaler ../helmchart/otel-add-on --namespace keda --create-namespace -f ./testdata/scaler-values.yaml"
9595
if len(otelScalerVersion) > 0 {
9696
cmd += fmt.Sprintf(" --set image.tag=%s", otelScalerVersion)
9797
}
@@ -119,8 +119,8 @@ var _ = Describe("Helm chart:", func() {
119119
waitForDeployment("keda-otel-scaler", "keda", defaultTimeoutSec)
120120
})
121121
})
122-
Context("Scaled Object", func() {
123-
When("is created", func() {
122+
Context("Scaled Object", Ordered, func() {
123+
When("is created", Ordered, func() {
124124
It("should not fail", func() {
125125
_, err := kapply("./testdata/podinfo-so.yaml")
126126
Expect(err).NotTo(HaveOccurred())
@@ -137,30 +137,31 @@ var _ = Describe("Helm chart:", func() {
137137
for {
138138
select {
139139
case <-cancelHey:
140+
//Expect(execCmdE("pkill hey")).NotTo(HaveOccurred())
140141
return
141142
default:
142-
hey("-z 60s http://localhost:8181/delay/1")
143+
hey("-z 40s http://localhost:8181")
143144
}
144145
}
145146
}()
146147
time.Sleep(1 * time.Second)
147148
ctx.t.Logf(" ->>> Waiting for KEDA to scale the podinfo deployement <<<-\n\n")
148-
ctx1min, _ := context.WithTimeout(context.TODO(), time.Minute)
149+
ctx2min, _ := context.WithTimeout(context.TODO(), 2*time.Minute)
149150
Eventually(func(g Gomega) {
150151
out, err := kubectl("get hpa keda-hpa-podinfo-pull-example -ojsonpath='{.status.desiredReplicas}'")
151152
g.Expect(err).Should(Not(HaveOccurred()))
152-
desiredReplicas, err := strconv.Atoi(strings.Trim(out, "'"))
153+
currentReplicas, err := strconv.Atoi(strings.Trim(out, "'"))
153154
g.Expect(err).Should(Not(HaveOccurred()))
154-
g.Expect(desiredReplicas).Should(And(BeNumerically(">", minReplicas), BeNumerically("<=", maxReplicas)))
155-
ctx.t.Logf("\n ->>> Pod info successfully scaled to %d <<<-\n\n", desiredReplicas)
155+
g.Expect(currentReplicas).Should(And(BeNumerically(">", minReplicas), BeNumerically("<=", maxReplicas)), fmt.Sprintf("# of replicas for podinfo (%d) should be > %d and <= %d", currentReplicas, minReplicas, maxReplicas))
156+
ctx.t.Logf("\n ->>> Pod info successfully scaled to %d <<<-\n\n", currentReplicas)
156157
GinkgoWriter.Println(" ->>> Pod info successfully scaled to")
157158
cancelHey <- true
158159
}).WithPolling(3 * time.Second).
159-
WithContext(ctx1min).
160+
WithContext(ctx2min).
160161
Should(Succeed())
161162
})
162163
time.Sleep(10 * time.Second)
163-
ctx10min, _ := context.WithTimeout(context.TODO(), 10*time.Minute)
164+
ctx15min, _ := context.WithTimeout(context.TODO(), 15*time.Minute)
164165
It("should eventually scale the podinfo back from N -> 1", func() {
165166
Eventually(func(g Gomega) {
166167
out, err := kubectl("get hpa keda-hpa-podinfo-pull-example -ojsonpath='{.status.desiredReplicas}'")
@@ -169,7 +170,7 @@ var _ = Describe("Helm chart:", func() {
169170
g.Expect(err).Should(Not(HaveOccurred()))
170171
g.Expect(desiredReplicas).Should(Equal(minReplicas))
171172
ctx.t.Logf("\n ->>> Pod info successfuly scaled back to %d <<<-\n\n", desiredReplicas)
172-
}).WithPolling(5 * time.Second).WithTimeout(10 * time.Minute).WithContext(ctx10min).Should(Succeed())
173+
}).WithPolling(5 * time.Second).WithTimeout(10 * time.Minute).WithContext(ctx15min).Should(Succeed())
173174
})
174175
})
175176
})
@@ -192,9 +193,10 @@ var _ = ReportAfterSuite("ReportAfterSuite", func(report Report) {
192193

193194
func PrintLogs() {
194195
if printLogs == "true" {
195-
wrapInSection("HPA", "get hpa keda-hpa-podinfo-pull-example -oyaml")
196-
wrapInSection("SO", "get so podinfo-pull-example -oyaml")
197-
wrapInSection("PODS", "get pods -A")
196+
wrapInSection("HPA brief", "get hpa -A")
197+
wrapInSection("HPA full", "get hpa -A -oyaml")
198+
wrapInSection("SO brief", "get so -A")
199+
wrapInSection("SO full", "get so -A -oyaml")
198200
for _, nameAndNs := range []string{"podinfo -ndefault",
199201
"keda-operator -nkeda",
200202
"otelCollector -nkeda",

e2e-tests/test_utils.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ import (
1212

1313
"github.com/gruntwork-io/terratest/modules/logger"
1414
"github.com/gruntwork-io/terratest/modules/shell"
15-
"github.com/kedacore/keda/v2/pkg/generated/clientset/versioned/typed/keda/v1alpha1"
1615
. "github.com/onsi/ginkgo/v2"
1716
. "github.com/onsi/gomega"
1817
"github.com/stretchr/testify/require"
1918
"k8s.io/client-go/kubernetes"
2019
"k8s.io/client-go/rest"
2120
"sigs.k8s.io/controller-runtime/pkg/client/config"
21+
22+
"github.com/kedacore/keda/v2/pkg/generated/clientset/versioned/typed/keda/v1alpha1"
2223
)
2324

2425
const (
@@ -67,6 +68,7 @@ type TestContext struct {
6768
kedaClient *v1alpha1.KedaV1alpha1Client
6869
k8sConfig *rest.Config
6970
hey string
71+
helm string
7072
}
7173

7274
func kubectl(args string) (string, error) {
@@ -163,20 +165,22 @@ func getClients() (*kubernetes.Clientset, *v1alpha1.KedaV1alpha1Client, *rest.Co
163165
}
164166

165167
func addHelmRepo(repoName string, repoUrl string) error {
166-
return execCmdE(fmt.Sprintf("helm repo add %s %s", repoName, repoUrl))
168+
return execCmdE(fmt.Sprintf("%s repo add %s %s", ctx.helm, repoName, repoUrl))
167169
}
168170

169171
func helmRepoUpdate(repoName string) error {
170-
return execCmdE(fmt.Sprintf("helm repo update %s", repoName))
172+
return execCmdE(fmt.Sprintf("%s repo update %s", ctx.helm, repoName))
171173
}
172174

173175
func helmChartInstall(repoName string, params string) error {
174-
return execCmdE(fmt.Sprintf("helm upgrade -i %s %s/%s %s", helmChartNames[repoName], repoName, helmChartNames[repoName], params))
176+
return execCmdE(fmt.Sprintf("%s upgrade -i %s %s/%s %s", ctx.helm, helmChartNames[repoName], repoName, helmChartNames[repoName], params))
175177
}
176178

177179
func installHelmCli() error {
180+
ctx.helm = "helm"
178181
_, err := exec.LookPath("helm")
179-
if err != nil {
182+
if err != nil || isCI == "true" {
183+
ctx.hey = "./bin/helm"
180184
err = execCmdE("curl -fsSL -o ./bin/get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3")
181185
require.NoErrorf(ctx.t, err, "cannot download helm installation shell script - %s", err)
182186

@@ -186,7 +190,7 @@ func installHelmCli() error {
186190
err = execCmdE("./bin/get_helm.sh")
187191
require.NoErrorf(ctx.t, err, "cannot download helm - %s", err)
188192
}
189-
err = execCmdE("helm version")
193+
err = execCmdE(ctx.helm + " version")
190194
return err
191195
}
192196

examples/metric-pull/podinfo-so.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ spec:
99
- type: external
1010
metadata:
1111
scalerAddress: "keda-otel-scaler.keda.svc:4318"
12-
metricQuery: "avg(http_request_duration_seconds_count{path=delay, method=GET, status=200})"
12+
metricQuery: "avg(http_request_duration_seconds_count{method=GET, status=200})"
1313
operationOverTime: "rate"
1414
targetValue: "2"
1515
clampMax: "600"

examples/metric-pull/scaler-with-collector-pull-tls-values.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,3 @@ otelCollector:
128128
logs:
129129
level: DEBUG
130130
metrics:
131-
address: 0.0.0.0:8888

examples/metric-pull/scaler-with-collector-pull-values.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ otelCollector:
2424
- 'watch'
2525
alternateConfig:
2626
receivers:
27-
opencensus:
2827
# https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/prometheusreceiver/README.md
2928
prometheus:
3029
config:
@@ -90,4 +89,3 @@ otelCollector:
9089
logs:
9190
level: DEBUG
9291
metrics:
93-
address: 0.0.0.0:8888

helmchart/otel-add-on/Chart.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
dependencies:
22
- name: opentelemetry-collector
33
repository: https://open-telemetry.github.io/opentelemetry-helm-charts
4-
version: 0.110.0
4+
version: 0.131.0
55
- name: opentelemetry-operator
66
repository: https://open-telemetry.github.io/opentelemetry-helm-charts
7-
version: 0.92.3
8-
digest: sha256:8ab2a14982ab80ec9bfb3b519269031a2675df4cafa42a53f05deba914eb8666
9-
generated: "2025-08-12T10:53:41.542619+02:00"
7+
version: 0.93.0
8+
digest: sha256:1e6cce235c8e646f7eacad82cd0014bc3489f7ce4c3bad36e1b4994853089a65
9+
generated: "2025-08-22T15:21:09.100405+02:00"

helmchart/otel-add-on/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ icon: https://raw.githubusercontent.com/kedacore/keda/main/images/keda-logo-500x
1010
dependencies:
1111
- name: opentelemetry-collector
1212
repository: https://open-telemetry.github.io/opentelemetry-helm-charts
13-
version: 0.110.0
13+
version: 0.131.0
1414
condition: opentelemetry-collector.enabled,otelCollector.enabled
1515
alias: otelCollector
1616
- name: opentelemetry-operator
1717
repository: https://open-telemetry.github.io/opentelemetry-helm-charts
18-
version: 0.92.3
18+
version: 0.93.0
1919
condition: opentelemetry-operator.enabled,otelOperator2.enabled
2020
alias: otelOperator
2121
home: https://github.com/kedify/otel-add-on

helmchart/otel-add-on/values.yaml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -450,24 +450,20 @@ otelCollector:
450450
mode: deployment
451451
image:
452452
# -- Container image - OTel collector distribution
453-
repository: otel/opentelemetry-collector-k8s
453+
# repository: otel/opentelemetry-collector-k8s
454+
repository: otel/opentelemetry-collector-contrib
454455
fullnameOverride: otelcol
455-
ports:
456-
opencensus:
457-
enabled: true
458-
containerPort: 55678
459-
servicePort: 55678
460-
hostPort: 55678
461-
protocol: TCP
456+
# ports:
457+
# opencensus:
458+
# enabled: true
459+
# containerPort: 55678
460+
# servicePort: 55678
461+
# hostPort: 55678
462+
# protocol: TCP
462463
# -- Configuration for OTel collector that will be installed
463464
# @notationType -- yaml
464465
alternateConfig:
465-
receivers:
466-
# https://grafana.com/docs/alloy/latest/reference/components/otelcol/otelcol.receiver.opencensus/
467-
opencensus:
468-
endpoint: 0.0.0.0:55678
469-
include_metadata: true
470-
466+
receivers: {}
471467
processors:
472468
resourcedetection/env:
473469
detectors: [ env ]
@@ -495,7 +491,7 @@ otelCollector:
495491
- health_check
496492
pipelines:
497493
metrics:
498-
receivers: [opencensus]
494+
receivers: []
499495
processors: [resourcedetection/env, transform]
500496
exporters: [debug, otlp]
501497

0 commit comments

Comments
 (0)