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

feat: Add API server cert SANs patch #129

Merged
merged 2 commits into from
Sep 1, 2023
Merged
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 capi-runtime-extensions.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"path": "."
},
{
"path": "./server"
"path": "./common"
}
],
"settings": {
Expand Down
2 changes: 2 additions & 0 deletions charts/capi-runtime-extensions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ A Helm chart for capi-runtime-extensions
| handlers.CalicoCNI.defaultPodSubnet | string | `"192.168.0.0/16"` | |
| handlers.CalicoCNI.defaultTigeraOperatorConfigMap.name | string | `"tigera-operator"` | |
| handlers.CalicoCNI.enabled | bool | `true` | |
| handlers.ExtraAPIServerCertSANsPatch.enabled | bool | `true` | |
| handlers.ExtraAPIServerCertSANsVars.enabled | bool | `true` | |
| handlers.HTTPProxyPatch.enabled | bool | `true` | |
| handlers.HTTPProxyVars.enabled | bool | `true` | |
| handlers.ServiceLoadBalancerGC.enabled | bool | `true` | |
Expand Down
45 changes: 45 additions & 0 deletions charts/capi-runtime-extensions/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,51 @@
"default": true
}
}
},
"HTTPProxyVars": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true
}
}
},
"HTTPProxyPatch": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true
}
}
},
"AuditPolicyPatch": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true
}
}
},
"APIServerCertSANsVars": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true
}
}
},
"APIServerCertSANsPatch": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true
}
}
}
}
},
Expand Down
4 changes: 4 additions & 0 deletions charts/capi-runtime-extensions/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ handlers:
enabled: true
AuditPolicyPatch:
enabled: true
ExtraAPIServerCertSANsVars:
enabled: true
ExtraAPIServerCertSANsPatch:
enabled: true

deployment:
replicas: 1
Expand Down
5 changes: 4 additions & 1 deletion cmd/capi-runtime-extensions/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
ctrclient "sigs.k8s.io/controller-runtime/pkg/client"

"github.com/d2iq-labs/capi-runtime-extensions/common/pkg/server"
"github.com/d2iq-labs/capi-runtime-extensions/internal/controllermanager"
"github.com/d2iq-labs/capi-runtime-extensions/pkg/handlers/cni/calico"
"github.com/d2iq-labs/capi-runtime-extensions/pkg/handlers/extraapiservercertsans"
"github.com/d2iq-labs/capi-runtime-extensions/pkg/handlers/httpproxy"
"github.com/d2iq-labs/capi-runtime-extensions/pkg/handlers/servicelbgc"
"github.com/d2iq-labs/capi-runtime-extensions/server/pkg/server"
)

var (
Expand Down Expand Up @@ -79,6 +80,8 @@ func main() {
calico.New(client, calicoCNIConfig),
httpproxy.NewVariable(),
httpproxy.NewPatch(),
extraapiservercertsans.NewVariable(),
extraapiservercertsans.NewPatch(),
)

// Initialize and parse command line flags.
Expand Down
38 changes: 23 additions & 15 deletions server/go.mod → common/go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
// Copyright 2023 D2iQ, Inc. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

module github.com/d2iq-labs/capi-runtime-extensions/server
module github.com/d2iq-labs/capi-runtime-extensions/common
jimmidyson marked this conversation as resolved.
Show resolved Hide resolved

go 1.21

require (
github.com/spf13/pflag v1.0.5
k8s.io/apiextensions-apiserver v0.28.1
k8s.io/apimachinery v0.28.1
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2
sigs.k8s.io/cluster-api v1.5.1
sigs.k8s.io/controller-runtime v0.15.1
sigs.k8s.io/controller-runtime v0.16.1
)

require (
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
Expand All @@ -22,12 +27,13 @@ require (
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // 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-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/cel-go v0.16.0 // 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/google/uuid v1.3.0 // indirect
Expand All @@ -42,28 +48,30 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/stoewer/go-strcase v1.2.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/net v0.13.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/sys v0.11.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
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.27.2 // indirect
k8s.io/apiextensions-apiserver v0.27.2 // indirect
k8s.io/apimachinery v0.27.2 // indirect
k8s.io/client-go v0.27.2 // indirect
k8s.io/component-base v0.27.2 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
k8s.io/api v0.28.1 // indirect
k8s.io/apiserver v0.28.1 // indirect
k8s.io/client-go v0.28.1 // indirect
k8s.io/component-base v0.28.1 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
Expand Down
Loading