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

chore: upgrade kubernetes dependencies to support upto k8s 1.25 #146

Merged
merged 6 commits into from Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
Bleeding-edge development, not yet released

## [0.12.0] - 2023-09-21
## Updated
- chore: upgrade kubernetes dependencies to support upto k8s 1.25 - #146
- Update to Golang 1.19 (#150)
- Bump k8s.io/client-go from 0.17.2 to 0.17.16 (#149)
- Bump github.com/prometheus/client_golang from 1.0.0 to 1.11.1 (#136)
- Bump golang.org/x/net from 0.0.0-20191004110552-13f9640d40b9 to 0.7.0 (#138)
- Bump gopkg.in/yaml.v3 from 3.0.0-20200615113413-eeeca48fe776 to 3.0.0 (#147)
- Bump github.com/gogo/protobuf (#148)
- Bump golang.org/x/crypto from 0.0.0-20190820162420-60c769a6c586 to 0.1.0 (#139)
- Bump golang.org/x/text from 0.3.2 to 0.3.8 (#137)
- Bump github.com/emicklei/go-restful (#135)

## [0.11.2] - 2023-04-05
## Updated
- feat: enable multi-architecture container image builds - #144
Expand Down
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -4,13 +4,13 @@
[![PR](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)][GithubPrsUrl]
[![slack](https://img.shields.io/badge/slack-join%20the%20conversation-ff69b4.svg)][SlackUrl]

![version](https://img.shields.io/badge/version-0.11.2-blue.svg?cacheSeconds=2592000)
![version](https://img.shields.io/badge/version-0.12.0-blue.svg?cacheSeconds=2592000)
[![Build Status][BuildStatusImg]][BuildMasterUrl]
[![codecov][CodecovImg]][CodecovUrl]
[![Go Report Card][GoReportImg]][GoReportUrl]

## Motivation
Active-Monitor is a Kubernetes custom resource controller which enables deep cluster monitoring and self-healing using [Argo workflows](https://github.com/argoproj/argo).
Active-Monitor is a Kubernetes custom resource controller which enables deep cluster monitoring and self-healing using [Argo workflows](https://github.com/argoproj/argo-workflows).

While it is not too difficult to know that all entities in a cluster are running individually, it is often quite challenging to know that they can all coordinate with each other as required for successful cluster operation (network connectivity, volume access, etc).

Expand Down Expand Up @@ -49,7 +49,7 @@ When the `level` is set to be `Cluster` the Active-Monitor will create a `Servic
* Kubernetes command line tool (kubectl)
* Access to Kubernetes Cluster as specified in `~/.kube/config`
* Easiest option is to install [minikube](https://minikube.sigs.k8s.io/docs/start/) and ensure that `kubectl version` returns client and server info
* [Argo Workflows Controller](https://github.com/argoproj/argo)
* [Argo Workflows Controller](https://github.com/argoproj/argo-workflows)

## Installation Guide
```
Expand Down
8 changes: 4 additions & 4 deletions api/v1alpha1/suite_test.go
Expand Up @@ -16,8 +16,8 @@ limitations under the License.
package v1alpha1

import (
"github.com/onsi/ginkgo/reporters"
"path/filepath"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
"testing"

. "github.com/onsi/ginkgo"
Expand All @@ -42,12 +42,12 @@ func TestAPIs(t *testing.T) {
RegisterFailHandler(Fail)

RunSpecsWithDefaultAndCustomReporters(t,
"Controller Suite",
[]Reporter{printer.NewlineReporter{}})
"Controller Suite", []Reporter{reporters.NewFakeReporter()},
)
}

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

By("bootstrapping test environment")
testEnv = &envtest.Environment{
Expand Down
131 changes: 65 additions & 66 deletions controllers/healthcheck_controller.go

Large diffs are not rendered by default.

17 changes: 7 additions & 10 deletions controllers/suite_test.go
Expand Up @@ -16,11 +16,11 @@ limitations under the License.
package controllers

import (
"context"
"github.com/go-logr/logr"
"k8s.io/client-go/rest"
"path/filepath"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sync"
Expand All @@ -45,14 +45,12 @@ var k8sClient client.Client
var testEnv *envtest.Environment

var mgr manager.Manager
var stopMgr chan struct{}
var ctx = context.Background()
var wg *sync.WaitGroup
var log logr.Logger

func TestAPIs(t *testing.T) {
RegisterFailHandler(Fail)

RunSpecsWithDefaultAndCustomReporters(t, "Controller Suite", []Reporter{printer.NewlineReporter{}})
}

var _ = BeforeSuite(func(done Done) {
Expand Down Expand Up @@ -89,29 +87,28 @@ var _ = BeforeSuite(func(done Done) {
err = NewHealthCheckReconciler(mgr, ctrl.Log.WithName("controllers").WithName("HealthCheck"), 10).SetupWithManager(mgr)
Expect(err).ToNot(HaveOccurred())

stopMgr, wg = StartTestManager(mgr)
wg = StartTestManager(mgr)

close(done)
}, 90)

var _ = AfterSuite(func() {
By("stopping manager")
close(stopMgr)
ctx.Done()
wg.Wait()

By("tearing down the test environment")
err := testEnv.Stop()
Expect(err).ToNot(HaveOccurred())
})

func StartTestManager(mgr manager.Manager) (chan struct{}, *sync.WaitGroup) {
stop := make(chan struct{})
func StartTestManager(mgr manager.Manager) *sync.WaitGroup {
wg := &sync.WaitGroup{}
go func() {
wg.Add(1)
//mgr.Start(stop)
Expect(mgr.Start(stop)).ToNot(HaveOccurred())
Expect(mgr.Start(ctx)).ToNot(HaveOccurred())
wg.Done()
}()
return stop, wg
return wg
}
129 changes: 66 additions & 63 deletions go.mod
Expand Up @@ -3,81 +3,84 @@ module github.com/keikoproj/active-monitor
go 1.19

require (
github.com/argoproj/argo v2.3.0+incompatible
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
github.com/go-logr/logr v0.1.0
github.com/argoproj/argo-workflows/v3 v3.4.8
github.com/ghodss/yaml v1.0.0
github.com/go-logr/logr v1.2.4
github.com/keikoproj/inverse-exp-backoff v0.0.0-20201007213207-e4a3ac0f74ab
github.com/mitchellh/mapstructure v1.1.2
github.com/onsi/ginkgo v1.12.0
github.com/onsi/gomega v1.8.1
github.com/prometheus/client_golang v1.11.1
github.com/mitchellh/mapstructure v1.5.0
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.27.7
github.com/prometheus/client_golang v1.16.0
github.com/robfig/cron/v3 v3.0.1
github.com/sirupsen/logrus v1.6.0
github.com/stretchr/testify v1.4.0
golang.org/x/net v0.7.0
gopkg.in/yaml.v3 v3.0.0
k8s.io/api v0.17.17
k8s.io/apimachinery v0.17.17
k8s.io/client-go v0.17.17
sigs.k8s.io/controller-runtime v0.5.0
github.com/sirupsen/logrus v1.9.2
github.com/stretchr/testify v1.8.2
golang.org/x/net v0.10.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.25.12
k8s.io/apimachinery v0.25.12
k8s.io/client-go v0.25.12
sigs.k8s.io/controller-runtime v0.13.1
)

require (
cloud.google.com/go v0.38.0 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
cloud.google.com/go/compute v1.19.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful v2.16.0+incompatible // indirect
github.com/evanphx/json-patch v4.9.0+incompatible // indirect
github.com/go-logr/zapr v0.1.0 // indirect
github.com/go-openapi/jsonpointer v0.19.3 // indirect
github.com/go-openapi/jsonreference v0.19.3 // indirect
github.com/go-openapi/spec v0.19.3 // indirect
github.com/go-openapi/swag v0.19.5 // indirect
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7 // indirect
github.com/golang/protobuf v1.4.3 // indirect
github.com/google/go-cmp v0.5.5 // indirect
github.com/google/gofuzz v1.0.0 // indirect
github.com/google/uuid v1.1.1 // indirect
github.com/googleapis/gnostic v0.3.1 // indirect
github.com/hashicorp/golang-lru v0.5.1 // indirect
github.com/hpcloud/tail v1.0.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/json-iterator/go v1.1.11 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
github.com/mailru/easyjson v0.7.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.26.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.3.2 // indirect
go.uber.org/multierr v1.1.0 // indirect
go.uber.org/zap v1.10.0 // indirect
golang.org/x/crypto v0.1.0 // indirect
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gomodules.xyz/jsonpatch/v2 v2.0.1 // indirect
google.golang.org/appengine v1.5.0 // indirect
google.golang.org/protobuf v1.26.0-rc.1 // indirect
gopkg.in/fsnotify.v1 v1.4.7 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/grpc v1.54.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
k8s.io/apiextensions-apiserver v0.17.2 // indirect
k8s.io/klog v1.0.0 // indirect
k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29 // indirect
k8s.io/utils v0.0.0-20191218082557-f07c713de883 // indirect
sigs.k8s.io/yaml v1.1.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/apiextensions-apiserver v0.25.12 // indirect
k8s.io/component-base v0.25.12 // indirect
k8s.io/klog/v2 v2.70.1 // indirect
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)