Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrades and maintenance #264

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile.runner
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM grafana/k6:latest
FROM grafana/k6:0.45.0

COPY --from=redboxoss/scuttle:latest scuttle /bin/scuttle
ENTRYPOINT ["scuttle", "k6"]
31 changes: 30 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)

# Image to use for building Go
GO_BUILDER_IMG ?= "golang:1.18"
# Image version to use for all building/pushing image targets
IMAGE_VERSION ?= v0.0.10rc3-202308031215

# Image URL to use all building/pushing image targets
IMG ?= ghcr.io/grafana/k6-operator:latest
IMG ?= 830473435438.dkr.ecr.us-west-2.amazonaws.com/k6-operator-controller:${IMAGE_VERSION}

# Default dockerfile to build
DOCKERFILE ?= "Dockerfile.controller"

# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true,crdVersions=v1,maxDescLen=0"

Expand Down Expand Up @@ -104,6 +109,30 @@ generate: controller-gen
docker-build: test
docker build . -t ${IMG} -f ${DOCKERFILE} --build-arg GO_BUILDER_IMG=${GO_BUILDER_IMG}

docker-build-controller:
docker build --pull . --build-arg GO_BUILDER_IMG=${GO_BUILDER_IMG} -t 830473435438.dkr.ecr.us-west-2.amazonaws.com/k6-operator-controller:${IMAGE_VERSION} -f Dockerfile.controller

docker-build-runner:
docker build --pull . -t 830473435438.dkr.ecr.us-west-2.amazonaws.com/k6-operator-runner:${IMAGE_VERSION} -f Dockerfile.runner

docker-build-starter:
docker build --pull . -t 830473435438.dkr.ecr.us-west-2.amazonaws.com/k6-operator-starter:${IMAGE_VERSION} -f Dockerfile.starter

docker-push-controller:
docker tag 830473435438.dkr.ecr.us-west-2.amazonaws.com/k6-operator-controller:${IMAGE_VERSION} 830473435438.dkr.ecr.us-west-2.amazonaws.com/k6-operator-controller:main
docker push 830473435438.dkr.ecr.us-west-2.amazonaws.com/k6-operator-controller:${IMAGE_VERSION}
docker push 830473435438.dkr.ecr.us-west-2.amazonaws.com/k6-operator-controller:main

docker-push-runner:
docker tag 830473435438.dkr.ecr.us-west-2.amazonaws.com/k6-operator-runner:${IMAGE_VERSION} 830473435438.dkr.ecr.us-west-2.amazonaws.com/k6-operator-runner:main
docker push 830473435438.dkr.ecr.us-west-2.amazonaws.com/k6-operator-runner:${IMAGE_VERSION}
docker push 830473435438.dkr.ecr.us-west-2.amazonaws.com/k6-operator-runner:main

docker-push-starter:
docker tag 830473435438.dkr.ecr.us-west-2.amazonaws.com/k6-operator-starter:${IMAGE_VERSION} 830473435438.dkr.ecr.us-west-2.amazonaws.com/k6-operator-starter:main
docker push 830473435438.dkr.ecr.us-west-2.amazonaws.com/k6-operator-starter:${IMAGE_VERSION}
docker push 830473435438.dkr.ecr.us-west-2.amazonaws.com/k6-operator-starter:main

# Push the docker image
docker-push:
docker push ${IMG}
Expand Down
4 changes: 2 additions & 2 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ resources:
- manager.yaml
images:
- name: controller
newName: ghcr.io/grafana/k6-operator
newTag: latest
newName: 830473435438.dkr.ecr.us-west-2.amazonaws.com/k6-operator-controller
newTag: v0.0.10rc3-202308031215
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
13 changes: 13 additions & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ metadata:
namespace: system
labels:
control-plane: controller-manager
tags.datadoghq.com/env: "edge"
tags.datadoghq.com/service: "laasie-k6-operator-controller"
tags.datadoghq.com/version: "v0.0.7-202208081725"
spec:
selector:
matchLabels:
Expand All @@ -23,6 +26,9 @@ spec:
metadata:
labels:
control-plane: controller-manager
tags.datadoghq.com/env: "edge"
tags.datadoghq.com/service: "laasie-k6-operator-controller"
tags.datadoghq.com/version: "v0.0.7-202208081725"
spec:
serviceAccountName: k6-operator-controller
containers:
Expand All @@ -39,4 +45,11 @@ spec:
requests:
cpu: 100m
memory: 50Mi
env:
- name: DD_ENV # Note the datadog agent only supports literal values and doesn't work when DD_* env vars are set using fieldRef, configmap, or anything else.
value: "edge"
- name: DD_SERVICE
value: "laasie-k6-operator-controller"
- name: DD_VERSION
value: "v0.0.7-202208081725"
terminationGracePeriodSeconds: 10
1 change: 1 addition & 0 deletions config/rbac/privateloadzone_editor_role.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# permissions for end users to edit privateloadzones.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
9 changes: 9 additions & 0 deletions scripts/docker-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

# Be sure to set the IMAGE_VERSION env var in Makefile before you run this.

set -ev

make docker-build-controller
make docker-build-runner
make docker-build-starter
13 changes: 13 additions & 0 deletions scripts/docker-build-push-k6-only
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

# Use this script when you want to upgrade k6 but not k6-operator.
#
# First change the k6 version in Dockerfile.runner, then run this script.

set -ev

make docker-build-runner

aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 830473435438.dkr.ecr.us-west-2.amazonaws.com

make docker-push-runner
9 changes: 9 additions & 0 deletions scripts/docker-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -ev

aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 830473435438.dkr.ecr.us-west-2.amazonaws.com

make docker-push-controller
make docker-push-runner
make docker-push-starter
Loading