Skip to content

Commit

Permalink
Update KCM node monitor grace period
Browse files Browse the repository at this point in the history
  • Loading branch information
muraee committed Dec 16, 2024
1 parent 0889812 commit 286d57f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ spec:
- --cluster-signing-duration=17520h
- --tls-cert-file=/etc/kubernetes/certs/server/tls.crt
- --tls-private-key-file=/etc/kubernetes/certs/server/tls.key
- --node-monitor-grace-period=50s
- --cluster-cidr=10.132.0.0/14
- --service-cluster-ip-range=
- --node-monitor-grace-period=50s
- --tls-min-version=VersionTLS12
- --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
- --feature-gates=OpenShiftPodSecurityAdmission=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ spec:
- --cluster-signing-duration=17520h
- --tls-cert-file=/etc/kubernetes/certs/server/tls.crt
- --tls-private-key-file=/etc/kubernetes/certs/server/tls.key
- --node-monitor-grace-period=50s
- --cluster-cidr=10.132.0.0/14
- --service-cluster-ip-range=
- --node-monitor-grace-period=50s
- --tls-min-version=VersionTLS12
- --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
- --feature-gates=OpenShiftPodSecurityAdmission=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ kind: Deployment
metadata:
name: kube-controller-manager
spec:
replicas: 1
revisionHistoryLimit: 2
selector:
matchLabels:
Expand Down Expand Up @@ -49,7 +48,6 @@ spec:
- --cluster-signing-duration=17520h
- --tls-cert-file=/etc/kubernetes/certs/server/tls.crt
- --tls-private-key-file=/etc/kubernetes/certs/server/tls.key
- --node-monitor-grace-period=50s
command:
- hyperkube
- kube-controller-manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/utils/ptr"

"sigs.k8s.io/controller-runtime/pkg/client"
)
Expand All @@ -35,6 +34,13 @@ func adaptDeployment(cpContext component.WorkloadContext, deployment *appsv1.Dep
if hcp.Spec.Platform.Type == hyperv1.AzurePlatform {
c.Args = append(c.Args, fmt.Sprintf("--cloud-provider=%s", "external"))
}

if hcp.Spec.Platform.Type == hyperv1.IBMCloudPlatform {
c.Args = append(c.Args, "--node-monitor-grace-period=55s")
} else {
c.Args = append(c.Args, "--node-monitor-grace-period=50s")
}

if tlsMinVersion := config.MinTLSVersion(hcp.Spec.Configuration.GetTLSSecurityProfile()); tlsMinVersion != "" {
c.Args = append(c.Args, fmt.Sprintf("--tls-min-version=%s", tlsMinVersion))
}
Expand All @@ -44,6 +50,7 @@ func adaptDeployment(cpContext component.WorkloadContext, deployment *appsv1.Dep
if util.StringListContains(hcp.Annotations[hyperv1.DisableProfilingAnnotation], ComponentName) {
c.Args = append(c.Args, "--profiling=false")
}

for _, f := range config.FeatureGates(hcp.Spec.Configuration.GetFeatureGateSelection()) {
c.Args = append(c.Args, fmt.Sprintf("--feature-gates=%s", f))
}
Expand All @@ -69,11 +76,6 @@ func adaptDeployment(cpContext component.WorkloadContext, deployment *appsv1.Dep
}
})

deployment.Spec.Replicas = ptr.To[int32](2)
if hcp.Spec.ControllerAvailabilityPolicy == hyperv1.SingleReplica {
deployment.Spec.Replicas = ptr.To[int32](1)
}

return nil
}

Expand Down

0 comments on commit 286d57f

Please sign in to comment.