Skip to content

Commit

Permalink
from k6io to grafana
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel González Lopes <[email protected]>
  • Loading branch information
dgzlopes committed Aug 5, 2021
1 parent ffdd915 commit b9a36a4
Show file tree
Hide file tree
Showing 19 changed files with 34 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: |
kubectl cluster-info
kubectl apply -f rendered.yaml
kubectl set image deployment/k6-operator-controller-manager manager=ghcr.io/k6io/operator:${{ env.GITHUB_SHA }} --record
kubectl set image deployment/k6-operator-controller-manager manager=ghcr.io/grafana/operator:${{ env.GITHUB_SHA }} --record
sleep 30
kubectl create configmap crocodile-stress-test --from-file e2e/test.js
kubectl apply -f e2e/test.yaml
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endif
BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)

# Image URL to use all building/pushing image targets
IMG ?= ghcr.io/k6io/operator:latest
IMG ?= ghcr.io/grafana/operator:latest
# Default dockerfile to build
DOCKERFILE ?= "Dockerfile.controller"
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
Expand Down
4 changes: 2 additions & 2 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
domain: io
layout: go.kubebuilder.io/v2
projectName: operator
repo: github.com/k6io/operator
repo: github.com/grafana/k6-operator
resources:
-
controller: true
domain: io
group: k6
kind: K6
path: github.com/k6io/operator/api/v1alpha1
path: github.com/grafana/k6-operator/api/v1alpha1
version: v1alpha1
version: "3"
plugins:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
> This project is **experimental** and changes a lot between commits.
> Use at your own risk.
`k6io/operator` is a kubernetes operator for running distributed k6 tests in your cluster.
`grafana/k6-operator` is a kubernetes operator for running distributed k6 tests in your cluster.

Read also the [complete tutorial](https://k6.io/blog/running-distributed-tests-on-k8s/) to learn more about how to use this project.

Expand Down Expand Up @@ -131,7 +131,7 @@ $ kubectl delete -f /path/to/your/k6-resource.yml

### Using extensions
By default, the operator will use `loadimpact/k6:latest` as the container image for the test jobs. If you want to use
extensions built with [xk6](https://github.com/k6io/xk6) you'll need to create your own image and override the `image`
extensions built with [xk6](https://github.com/grafana/xk6) you'll need to create your own image and override the `image`
property on the `K6` kubernetes resource. For example, the following Dockerfile can be used to create a container
image using github.com/szkiba/xk6-prometheus as an extension:

Expand All @@ -140,7 +140,7 @@ image using github.com/szkiba/xk6-prometheus as an extension:
# Build the k6 binary with the extension
FROM golang:1.16.4-buster as builder

RUN go install github.com/k6io/xk6/cmd/xk6@latest
RUN go install github.com/grafana/xk6/cmd/xk6@latest
RUN xk6 build --output /k6 --with github.com/szkiba/xk6-prometheus@latest

# Use the operator's base image and override the k6 binary
Expand Down
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resources:
- manager.yaml
images:
- name: controller
newName: ghcr.io/k6io/operator
newName: ghcr.io/grafana/operator
newTag: latest
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
2 changes: 1 addition & 1 deletion config/manifests/bases/operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
annotations:
alm-examples: "[]"
capabilities: Basic Install
containerImage: ghcr.io/k6io/operator
containerImage: ghcr.io/grafana/operator
repository: https://github.com/grafana/k6-operator
support: k6
name: k6-operator.v0.0.0
Expand Down
3 changes: 2 additions & 1 deletion controllers/k6_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ package controllers
import (
"context"
"fmt"

"github.com/go-logr/logr"
"github.com/k6io/operator/api/v1alpha1"
"github.com/grafana/k6-operator/api/v1alpha1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
Expand Down
4 changes: 2 additions & 2 deletions controllers/k6_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"

"github.com/go-logr/logr"
"github.com/k6io/operator/api/v1alpha1"
"github.com/k6io/operator/pkg/resources/jobs"
"github.com/grafana/k6-operator/api/v1alpha1"
"github.com/grafana/k6-operator/pkg/resources/jobs"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
Expand Down
4 changes: 2 additions & 2 deletions controllers/k6_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"time"

"github.com/go-logr/logr"
"github.com/k6io/operator/api/v1alpha1"
"github.com/k6io/operator/pkg/resources/jobs"
"github.com/grafana/k6-operator/api/v1alpha1"
"github.com/grafana/k6-operator/pkg/resources/jobs"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/util/wait"
Expand Down
2 changes: 1 addition & 1 deletion controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

k6v1alpha1 "github.com/k6io/operator/api/v1alpha1"
k6v1alpha1 "github.com/grafana/k6-operator/api/v1alpha1"
// +kubebuilder:scaffold:imports
)

Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/k6io/operator
module github.com/grafana/k6-operator

go 1.13

require (
github.com/go-logr/logr v0.1.0
github.com/go-test/deep v1.0.7 // indirect
github.com/go-test/deep v1.0.7
github.com/onsi/ginkgo v1.12.1
github.com/onsi/gomega v1.10.1
k8s.io/api v0.18.6
Expand All @@ -13,4 +13,4 @@ require (
sigs.k8s.io/controller-runtime v0.6.2
)

replace github.com/k6io/operator => ./
replace github.com/grafana/k6-operator => ./
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@ package main

import (
"flag"
"github.com/k6io/operator/controllers"
"os"

"github.com/grafana/k6-operator/controllers"

"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

k6v1alpha1 "github.com/k6io/operator/api/v1alpha1"
k6v1alpha1 "github.com/grafana/k6-operator/api/v1alpha1"
// +kubebuilder:scaffold:imports
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/jobs/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package jobs
import (
"strconv"

"github.com/k6io/operator/api/v1alpha1"
"github.com/grafana/k6-operator/api/v1alpha1"
corev1 "k8s.io/api/core/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/jobs/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/go-test/deep"
"github.com/k6io/operator/api/v1alpha1"
"github.com/grafana/k6-operator/api/v1alpha1"
corev1 "k8s.io/api/core/v1"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/resources/jobs/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

"strings"

"github.com/k6io/operator/api/v1alpha1"
"github.com/k6io/operator/pkg/segmentation"
"github.com/grafana/k6-operator/api/v1alpha1"
"github.com/grafana/k6-operator/pkg/segmentation"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/jobs/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

deep "github.com/go-test/deep"
"github.com/k6io/operator/api/v1alpha1"
"github.com/grafana/k6-operator/api/v1alpha1"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
4 changes: 2 additions & 2 deletions pkg/resources/jobs/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"strconv"

"github.com/k6io/operator/api/v1alpha1"
"github.com/k6io/operator/pkg/resources/containers"
"github.com/grafana/k6-operator/api/v1alpha1"
"github.com/grafana/k6-operator/pkg/resources/containers"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
4 changes: 2 additions & 2 deletions pkg/resources/jobs/starter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"testing"

deep "github.com/go-test/deep"
"github.com/k6io/operator/api/v1alpha1"
"github.com/k6io/operator/pkg/resources/containers"
"github.com/grafana/k6-operator/api/v1alpha1"
"github.com/grafana/k6-operator/pkg/resources/containers"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
5 changes: 3 additions & 2 deletions pkg/segmentation/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package segmentation_test

import (
"fmt"
"github.com/k6io/operator/pkg/segmentation"
"testing"

"github.com/grafana/k6-operator/pkg/segmentation"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
"testing"
)

func TestSegmentation(t *testing.T) {
Expand Down

0 comments on commit b9a36a4

Please sign in to comment.