Skip to content

Commit

Permalink
bump controller-runtime, k8s/golang/workflow-controller version (#96)
Browse files Browse the repository at this point in the history
* bump controller-runtime, k8s/golang/workflow-controller version

Signed-off-by: jhu02 <[email protected]>

* Add resource observation function; update workflow-controller version

Signed-off-by: jhu02 <[email protected]>

* Fix docker image role error

Signed-off-by: jhu02 <[email protected]>

* Update config/crd/patches/webhook_in_addons.yaml

Co-authored-by: Shail Shah <[email protected]>
Signed-off-by: jhu02 <[email protected]>

* Update config/crd/patches/cainjection_in_addons.yaml

Co-authored-by: Shail Shah <[email protected]>
Signed-off-by: jhu02 <[email protected]>

* Update controllers/addon_controller.go

Co-authored-by: Shail Shah <[email protected]>
Signed-off-by: jhu02 <[email protected]>

* typos

Signed-off-by: jhu02 <[email protected]>

* only watch workflow in the addon-manager-system namespace

Signed-off-by: jhu02 <[email protected]>

* fix e2e tests

Signed-off-by: jhu02 <[email protected]>

* per kevin's suggestion, remove argo workflow api watch from clusterrole

Signed-off-by: jhu02 <[email protected]>

* format

Signed-off-by: jhu02 <[email protected]>

* add leases using "marker comments"

Signed-off-by: jhu02 <[email protected]>

* use marker-comments for lease resources
Signed-off-by: jhu02 <[email protected]>

* cleanup roles/marker-comment

Signed-off-by: jhu02 <[email protected]>

* graceful solution of duplicated addons

Signed-off-by: jhu02 <[email protected]>

* add comments of nocached

Signed-off-by: jhu02 <[email protected]>

* remove workflows from clusterrole watch

Signed-off-by: jhu02 <[email protected]>

* revert workflows cluster roles

Signed-off-by: jhu02 <[email protected]>

* Add test-load for confidence

Signed-off-by: jhu02 <[email protected]>

* Speed up load-tests

Signed-off-by: jhu02 <[email protected]>

* concurrently load tests

Signed-off-by: jhu02 <[email protected]>

* refactor load-tests for previous version and current version comparison

Signed-off-by: jhu02 <[email protected]>

* refactor load-test main

Signed-off-by: jhu02 <[email protected]>

* adjust load test retry mechanism

Signed-off-by: jhu02 <[email protected]>

* remove workflows api from cluster role

Signed-off-by: jhu02 <[email protected]>

* start workflowinformers

Signed-off-by: jhu02 <[email protected]>

* informers changes

Signed-off-by: jhu02 <[email protected]>

* Address comments, rename functionality

Signed-off-by: jhu02 <[email protected]>

* Revert removed generatedInformers initialization

Signed-off-by: jhu02 <[email protected]>

* cleanup broaden informer watch

Signed-off-by: jhu02 <[email protected]>

* a little bit efficiency cleanup

Signed-off-by: jhu02 <[email protected]>

* cleanup++

Signed-off-by: jhu02 <[email protected]>

* optimization

Signed-off-by: jhu02 <[email protected]>

* per kevin's suggestion: get rid of duplicate

Signed-off-by: jhu02 <[email protected]>

Co-authored-by: jhu02 <[email protected]>
Co-authored-by: Shail Shah <[email protected]>
  • Loading branch information
3 people authored Feb 12, 2022
1 parent c3ff3e6 commit ff34241
Show file tree
Hide file tree
Showing 22 changed files with 1,685 additions and 505 deletions.
27 changes: 21 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
ARG SOURCE_BINARY=bin/manager
FROM golang:1.17 as builder

ARG TAG
ARG COMMIT
ARG REPO_INFO
WORKDIR /workspace

ADD go.mod .
ADD go.sum .
RUN go mod download

COPY pkg/ pkg/
COPY api/ api/
COPY cmd/ cmd/
COPY controllers/ controllers/
COPY main.go main.go
# Build
RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -a -o manager main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot
FROM gcr.io/distroless/static:nonroot AS distroless
WORKDIR /
COPY ${SOURCE_BINARY} .
EXPOSE 8080 8443
COPY --from=builder /workspace/manager .
USER nonroot:nonroot

ENTRYPOINT ["/manager"]
CMD ["--debug=true"]
ENTRYPOINT ["/manager"]
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ else
GOBIN=$(shell go env GOBIN)
endif

LOADTEST_TIMEOUT ?= "60m"
LOADTEST_START_NUMBER ?= 1
LOADTEST_END_NUMBER ?= 2000

.EXPORT_ALL_VARIABLES:
GO111MODULE=on

Expand All @@ -27,6 +31,9 @@ test: generate fmt vet manifests
bdd: fmt vet deploy
go test -timeout 5m -v ./test-bdd/...

loadtest: fmt vet deploy
go test -timeout $(LOADTEST_TIMEOUT) -startnumber $(LOADTEST_START_NUMBER) -endnumber $(LOADTEST_END_NUMBER) -v ./test-load/...

# Build manager binary
manager: generate fmt vet
go build -race -o bin/manager main.go
Expand Down
5 changes: 3 additions & 2 deletions api/v1alpha1/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"path/filepath"
"testing"

"github.com/go-logr/logr"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

Expand All @@ -27,7 +28,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
)

// These tests use Ginkgo (BDD-style Go testing framework). Refer to
Expand All @@ -36,6 +36,7 @@ import (
var cfg *rest.Config
var k8sClient client.Client
var testEnv *envtest.Environment
var log logr.Logger

func TestAPIs(t *testing.T) {
RegisterFailHandler(Fail)
Expand All @@ -46,7 +47,7 @@ func TestAPIs(t *testing.T) {
}

var _ = BeforeSuite(func(done Done) {
logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
logf.SetLogger(log)

By("bootstrapping test environment")
testEnv = &envtest.Environment{
Expand Down
8 changes: 5 additions & 3 deletions config/argo/argo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ rules:
resources:
- workflows
- workflows/finalizers
- workflowtasksets
- workflowtasksets/finalizers
verbs:
- get
- list
Expand Down Expand Up @@ -166,7 +168,7 @@ spec:
- --configmap
- addon-manager-workflow-controller-configmap
- --executor-image
- argoproj/argoexec:v3.0.7
- argoproj/argoexec:v3.2.6
- --namespaced
command:
- workflow-controller
Expand All @@ -176,7 +178,7 @@ spec:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
image: docker.io/argoproj/workflow-controller:v3.0.7
image: docker.io/argoproj/workflow-controller:v3.2.6
livenessProbe:
failureThreshold: 3
httpGet:
Expand Down Expand Up @@ -210,7 +212,7 @@ metadata:
namespace: system
spec:
pkgName: addon-argo-workflow
pkgVersion: v3.0.7
pkgVersion: v3.2.6
pkgType: composite
pkgDescription: "Argo Workflow Controller for Addon Controller."
params:
Expand Down
40 changes: 40 additions & 0 deletions config/crd/bases/argoproj_v1alpha1_workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,43 @@ spec:
type: object
served: true
storage: true
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: workflowtasksets.argoproj.io
spec:
group: argoproj.io
names:
kind: WorkflowTaskSet
listKind: WorkflowTaskSetList
plural: workflowtasksets
shortNames:
- wfts
singular: workflowtaskset
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
type: object
x-kubernetes-map-type: atomic
x-kubernetes-preserve-unknown-fields: true
status:
type: object
x-kubernetes-map-type: atomic
x-kubernetes-preserve-unknown-fields: true
required:
- metadata
- spec
type: object
served: true
storage: true
4 changes: 2 additions & 2 deletions config/crd/patches/cainjection_in_addons.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The following patch adds a directive for certmanager to inject CA into the CRD
# CRD conversion requires k8s 1.13 or later.
apiVersion: apiextensions.k8s.io/v1beta1
# CRD conversion requires k8s 1.16 or later.
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
Expand Down
4 changes: 2 additions & 2 deletions config/crd/patches/webhook_in_addons.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The following patch enables conversion webhook for CRD
# CRD conversion requires k8s 1.13 or later.
apiVersion: apiextensions.k8s.io/v1beta1
# CRD conversion requires k8s 1.16 or later.
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: addons.addonmgr.keikoproj.io
Expand Down
2 changes: 1 addition & 1 deletion config/default/manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
spec:
containers:
- name: kube-rbac-proxy
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.10.0
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
args:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/"
Expand Down
Loading

0 comments on commit ff34241

Please sign in to comment.