Skip to content

Commit

Permalink
Merge branch 'main' into task/2190
Browse files Browse the repository at this point in the history
  • Loading branch information
iblancasa authored Jun 14, 2023
2 parents a337b42 + 723105f commit 2c1c4ec
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: docker/[email protected]
- uses: docker/setup-buildx-action@v2.5.0
- uses: docker/setup-buildx-action@v2.6.0
- name: "publishes the images"
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: ./hack/install/install-kustomize.sh

- uses: docker/[email protected]
- uses: docker/setup-buildx-action@v2.5.0
- uses: docker/setup-buildx-action@v2.6.0

- name: "generate release resources"
run: make release-artifacts USER=jaegertracing
Expand Down
5 changes: 1 addition & 4 deletions bundle/manifests/jaeger-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ metadata:
categories: Logging & Tracing
certified: "false"
containerImage: quay.io/jaegertracing/jaeger-operator
createdAt: "2023-05-16T04:47:12Z"
createdAt: "2023-05-29T15:36:04Z"
description: Provides tracing, monitoring and troubleshooting for microservices-based
distributed systems
operators.openshift.io/infrastructure-features: '["disconnected"]'
Expand Down Expand Up @@ -422,9 +422,6 @@ spec:
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 128Mi
Expand Down
3 changes: 0 additions & 3 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ spec:
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 128Mi
Expand Down
16 changes: 9 additions & 7 deletions pkg/cronjob/es_index_cleaner.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,15 @@ func CreateEsIndexCleaner(jaeger *v1.Jaeger) runtime.Object {
Spec: corev1.PodSpec{
Containers: []corev1.Container{
{
Name: util.Truncate(name, 63),
Image: util.ImageName(jaeger.Spec.Storage.EsIndexCleaner.Image, "jaeger-es-index-cleaner-image"),
Args: []string{strconv.Itoa(*jaeger.Spec.Storage.EsIndexCleaner.NumberOfDays), esUrls},
Env: util.RemoveEmptyVars(envs),
EnvFrom: envFromSource,
Resources: commonSpec.Resources,
VolumeMounts: commonSpec.VolumeMounts,
Name: util.Truncate(name, 63),
Image: util.ImageName(jaeger.Spec.Storage.EsIndexCleaner.Image, "jaeger-es-index-cleaner-image"),
ImagePullPolicy: jaeger.Spec.Storage.EsIndexCleaner.ImagePullPolicy,
Args: []string{strconv.Itoa(*jaeger.Spec.Storage.EsIndexCleaner.NumberOfDays), esUrls},
Env: util.RemoveEmptyVars(envs),
EnvFrom: envFromSource,
SecurityContext: jaeger.Spec.Storage.EsIndexCleaner.ContainerSecurityContext,
Resources: commonSpec.Resources,
VolumeMounts: commonSpec.VolumeMounts,
},
},
ImagePullSecrets: commonSpec.ImagePullSecrets,
Expand Down
31 changes: 31 additions & 0 deletions pkg/cronjob/es_index_cleaner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,34 @@ func TestEsIndexCleanerImagePullSecrets(t *testing.T) {

assert.Equal(t, pullSecret, esIndexCleaner.Spec.JobTemplate.Spec.Template.Spec.ImagePullSecrets[0].Name)
}

func TestEsIndexCleanerImagePullPolicy(t *testing.T) {
jaeger := v1.NewJaeger(types.NamespacedName{Name: "TestEsIndexCleanerImagePullPolicy"})
days := 0
jaeger.Spec.Storage.EsIndexCleaner.NumberOfDays = &days

const ImagePullPolicy = corev1.PullPolicy("Always")
jaeger.Spec.Storage.EsIndexCleaner.NumberOfDays = &days
jaeger.Spec.Storage.EsIndexCleaner.ImagePullPolicy = corev1.PullPolicy("Always")

esIndexCleaner := CreateEsIndexCleaner(jaeger).(*batchv1.CronJob)

assert.Equal(t, ImagePullPolicy, esIndexCleaner.Spec.JobTemplate.Spec.Template.Spec.Containers[0].ImagePullPolicy)
}

func TestEsIndexCleaneContainerSecurityContext(t *testing.T) {
jaeger := v1.NewJaeger(types.NamespacedName{Name: "TestEsIndexCleanerContainerSecurityContext"})
days := 0
jaeger.Spec.Storage.EsIndexCleaner.NumberOfDays = &days

true := true
ContainerSecurityContext := &corev1.SecurityContext{
ReadOnlyRootFilesystem: &true,
}
jaeger.Spec.Storage.EsIndexCleaner.NumberOfDays = &days
jaeger.Spec.Storage.EsIndexCleaner.ContainerSecurityContext = ContainerSecurityContext

esIndexCleaner := CreateEsIndexCleaner(jaeger).(*batchv1.CronJob)

assert.Equal(t, ContainerSecurityContext, esIndexCleaner.Spec.JobTemplate.Spec.Template.Spec.Containers[0].SecurityContext)
}
7 changes: 0 additions & 7 deletions tests/e2e/miscellaneous/collector-autoscale/02-assert.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: "./wait-for-hpa.sh"
10 changes: 10 additions & 0 deletions tests/e2e/miscellaneous/collector-autoscale/wait-for-hpa.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
exit_code=0

while [ "$exit_code" == 0 ]
do
kubectl get hpa -n $NAMESPACE | grep "<unknown>/90% <unknown>/90%" -q
exit_code=$?
echo "Some HPA metrics are not known yet"
sleep 1
done
5 changes: 2 additions & 3 deletions tests/e2e/miscellaneous/render.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,15 @@ fi
ELASTICSEARCH_NODECOUNT="1"
render_install_jaeger "$jaeger_name" "$jaeger_deploy_mode" "01"
# Change the resource limits for the Jaeger deployment
$YQ e -i '.spec.collector.resources.requests.memory="20Mi"' 01-install.yaml
$YQ e -i '.spec.collector.resources.requests.memory="300m"' 01-install.yaml
$YQ e -i '.spec.collector.resources.requests.memory="200m"' 01-install.yaml

# Enable autoscale
$YQ e -i '.spec.collector.autoscale=true' 01-install.yaml
$YQ e -i '.spec.collector.minReplicas=1' 01-install.yaml
$YQ e -i '.spec.collector.maxReplicas=2' 01-install.yaml

# Deploy Tracegen instance to generate load in the Jaeger collector
render_install_tracegen "$jaeger_name" "02"
render_install_tracegen "$jaeger_name" "03"


###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/render-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ function render_install_tracegen() {
step=$2

# We detected this value is good enough to make the operator scale
replicas=4
replicas=1

$GOMPLATE -f $EXAMPLES_DIR/tracegen.yaml -o ./$step-install.yaml
$YQ e -i ".spec.replicas=$replicas" ./$step-install.yaml
Expand Down

0 comments on commit 2c1c4ec

Please sign in to comment.