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

Initial loadbalancer implementation #5

Merged
merged 27 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e0dee55
Exclude binaries from git
href Sep 20, 2023
d635f94
Update dependencies
href Sep 20, 2023
a223196
Fix API timeout and increase default
href Oct 3, 2023
be05574
Enforce a consistent line-length
href Oct 3, 2023
78bcede
Add support for LoadBalancer type services
href Oct 5, 2023
50c7a07
Move limiter to an internal module
href Oct 5, 2023
e50ef39
Add end-to-end test for a loadbalancer service
href Oct 6, 2023
10281fe
Use k8test:denis/private-network on GitHub for now
href Oct 6, 2023
cd45a00
Revert "Use k8test:denis/private-network on GitHub for now"
href Oct 12, 2023
559f781
Use a slightly higher timeout
href Oct 19, 2023
fc61a82
Prevent integration tests from running in parallel
href Oct 19, 2023
4f34196
Limit workflows to main branch, pull requests, manual runs
href Oct 19, 2023
9736413
Add the ability to override the Kubernetes version to test
href Oct 20, 2023
2ebfe57
Move serverMapper to loadbalancer struct
href Oct 20, 2023
aa6f9da
Correct wrong information in comment
href Oct 20, 2023
53ffbac
Add missing space to error message
href Oct 20, 2023
459d551
Move patching functions to an internal package
href Oct 24, 2023
92e775c
Add support for ExternalTrafficPolicy=Local
href Oct 25, 2023
8ac8909
Replace service.beta.kubernetes.io
href Oct 25, 2023
73c6ae6
Fix HTTP Options not being updateable
href Oct 25, 2023
db40142
Remove TODOs, they are now tracked in tickets
href Oct 25, 2023
15332ec
Upgrade to cloudscale-go-sdk v4
href Oct 25, 2023
213857c
Increase the timeout for service creation in integration tests
href Oct 25, 2023
56a9d26
Improve end-to-end test with log scanning
href Oct 25, 2023
872b5c9
Allow two service workers by default
href Oct 25, 2023
4437af7
Fix switch between external local policy showing an error
href Oct 27, 2023
7ad7080
Add logging to integration tests, as they are quite long
href Oct 27, 2023
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.iml
cover.out
k8test
bin/
27 changes: 27 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
linters:
disable-all: true
enable:
- errcheck
- exportloopref
- gocritic
- gofmt
- gosimple
- govet
- ineffassign
- lll
- makezero
- staticcheck
- unparam
- unused
- wrapcheck

linters-settings:
lll:
line-length: 80
tab-width: 4

issues:
exclude-rules:
- linters:
- lll
source: ".+LoadBalancer|// http(s)://"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20-alpine AS build
FROM golang:1.21-alpine AS build
ARG VERSION

RUN apk add --no-cache git
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ lint:
staticcheck ./...

test:
go test -race -coverpkg=./pkg/cloudscale_ccm -coverprofile cover.out ./pkg/cloudscale_ccm -v
go test -race -v \
-coverpkg=./pkg/cloudscale_ccm,./pkg/internal/actions,./pkg/internal/compare \
-coverprofile cover.out \
./pkg/cloudscale_ccm \
./pkg/internal/actions \
./pkg/internal/compare

integration:
K8TEST_PATH=${PWD}/k8test go test -count=1 -tags=integration ./pkg/internal/integration -v
Expand Down
5 changes: 4 additions & 1 deletion cmd/cloudscale-cloud-controller-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
cloudprovider "k8s.io/cloud-provider"
"k8s.io/cloud-provider/app"
"k8s.io/cloud-provider/app/config"
"k8s.io/cloud-provider/names"
"k8s.io/cloud-provider/options"
"k8s.io/component-base/cli"
cliflag "k8s.io/component-base/cli/flag"
Expand All @@ -32,8 +33,10 @@ func main() {
ccmOptions,
cloudInitializer,
app.DefaultInitFuncConstructors,
names.CCMControllerAliases(),
cliflag.NamedFlagSets{},
wait.NeverStop)
wait.NeverStop,
)

os.Exit(cli.Run(cmd))
}
Expand Down
9 changes: 9 additions & 0 deletions deploy/kubernetes/releases/latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ rules:
- patch
- update
- watch
- apiGroups:
- ""
resources:
- services/status
verbs:
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
Expand Down
37 changes: 18 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ module github.com/cloudscale-ch/cloudscale-cloud-controller-manager
go 1.21

require (
github.com/cloudscale-ch/cloudscale-go-sdk v1.11.0
golang.org/x/oauth2 v0.9.0
k8s.io/api v0.27.3
k8s.io/apimachinery v0.27.3
k8s.io/cloud-provider v0.27.3
k8s.io/component-base v0.27.3
k8s.io/api v0.28.2
k8s.io/apimachinery v0.28.2
k8s.io/cloud-provider v0.28.2
k8s.io/component-base v0.28.2
k8s.io/klog/v2 v2.100.1
)

require (
github.com/cloudscale-ch/cloudscale-go-sdk/v3 v3.0.0
github.com/google/uuid v1.3.0
github.com/stretchr/testify v1.8.3
k8s.io/client-go v0.28.2
)

require (
Expand Down Expand Up @@ -42,8 +43,8 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/cel-go v0.16.0 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/cel-go v0.16.1 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
Expand All @@ -54,7 +55,6 @@ require (
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/mitchellh/mapstructure v1.4.1 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
Expand Down Expand Up @@ -84,13 +84,13 @@ require (
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.10.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect
golang.org/x/net v0.11.0 // indirect
golang.org/x/net v0.13.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/term v0.9.0 // indirect
golang.org/x/text v0.10.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect
Expand All @@ -102,12 +102,11 @@ require (
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiserver v0.27.3 // indirect
k8s.io/client-go v0.27.3 // indirect
k8s.io/component-helpers v0.27.3 // indirect
k8s.io/controller-manager v0.27.3 // indirect
k8s.io/kms v0.27.3 // indirect
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
k8s.io/apiserver v0.28.2 // indirect
k8s.io/component-helpers v0.28.2 // indirect
k8s.io/controller-manager v0.28.2 // indirect
k8s.io/kms v0.28.2 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230505201702-9f6742963106 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.3 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
Expand Down
Loading