Skip to content

Commit

Permalink
adds minimal-rotation-time parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Disper committed Dec 13, 2023
1 parent a755aaf commit 7ddc532
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/log/zap"
)

// The ratio determines what is the minimal time that needs to pass to rotate certificate.
const minimalRotationTimeRatio = 0.6

var (
scheme = runtime.NewScheme() //nolint:gochecknoglobals
setupLog = ctrl.Log.WithName("setup") //nolint:gochecknoglobals
Expand All @@ -55,6 +52,7 @@ func init() {
//+kubebuilder:scaffold:scheme
}

const defaultMinimalRotationTimeRatio = 0.6
const defaultExpirationTime = 24 * time.Hour

func main() {
Expand All @@ -63,6 +61,7 @@ func main() {
var probeAddr string
var gardenerKubeconfigPath string
var gardenerProjectName string
var minimalRotationTimeRatio float64
var expirationTime time.Duration

flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
Expand All @@ -72,6 +71,7 @@ func main() {
"Enabling this will ensure there is only one active controller manager.")
flag.StringVar(&gardenerKubeconfigPath, "gardener-kubeconfig-path", "/gardener/kubeconfig/kubeconfig", "Kubeconfig file for Gardener cluster")
flag.StringVar(&gardenerProjectName, "gardener-project-name", "gardener-project", "Name of the Gardener project")
flag.Float64Var(&minimalRotationTimeRatio, "minimal-rotation-time", defaultMinimalRotationTimeRatio, "The ratio determines what is the minimal time that needs to pass to rotate certificate.")
flag.DurationVar(&expirationTime, "kubeconfig-expiration-time", defaultExpirationTime, "Dynamic kubeconfig expiration time")

opts := zap.Options{
Expand Down
1 change: 1 addition & 0 deletions config/default/manager_gardener_secret_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ spec:
- --gardener-kubeconfig-path=/gardener/credentials/kubeconfig
- --gardener-project-name=kyma-dev
- --kubeconfig-expiration-time=24h
- --minimal-rotation-time=0.6
volumeMounts:
- name: gardener-kubeconfig
mountPath: /gardener/credentials

0 comments on commit 7ddc532

Please sign in to comment.