Skip to content

Commit

Permalink
feat: add resources and use HTTPS checks in control plane pods
Browse files Browse the repository at this point in the history
- switch livenessProbe to ssl port
- add request resources

Signed-off-by: Serge Logvinov <[email protected]>
  • Loading branch information
sergelogvinov authored and talos-bot committed May 8, 2021
1 parent 4ffd7c0 commit 66b2b45
Showing 1 changed file with 25 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/cosi-project/runtime/pkg/resource"
"github.com/cosi-project/runtime/pkg/state"
v1 "k8s.io/api/core/v1"
apiresource "k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"

Expand Down Expand Up @@ -261,6 +262,12 @@ func (ctrl *ControlPlaneStaticPodController) manageAPIServer(ctx context.Context
ReadOnly: true,
},
}, volumeMounts(cfg.ExtraVolumes)...),
Resources: v1.ResourceRequirements{
Requests: v1.ResourceList{
v1.ResourceCPU: apiresource.MustParse("200m"),
v1.ResourceMemory: apiresource.MustParse("512Mi"),
},
},
},
},
HostNetwork: true,
Expand Down Expand Up @@ -348,13 +355,20 @@ func (ctrl *ControlPlaneStaticPodController) manageControllerManager(ctx context
LivenessProbe: &v1.Probe{
Handler: v1.Handler{
HTTPGet: &v1.HTTPGetAction{
Path: "/healthz",
Port: intstr.FromInt(10252),
Path: "/healthz",
Port: intstr.FromInt(10257),
Scheme: v1.URISchemeHTTPS,
},
},
InitialDelaySeconds: 15,
TimeoutSeconds: 15,
},
Resources: v1.ResourceRequirements{
Requests: v1.ResourceList{
v1.ResourceCPU: apiresource.MustParse("50m"),
v1.ResourceMemory: apiresource.MustParse("256Mi"),
},
},
},
},
HostNetwork: true,
Expand Down Expand Up @@ -430,13 +444,20 @@ func (ctrl *ControlPlaneStaticPodController) manageScheduler(ctx context.Context
LivenessProbe: &v1.Probe{
Handler: v1.Handler{
HTTPGet: &v1.HTTPGetAction{
Path: "/healthz",
Port: intstr.FromInt(10251),
Path: "/healthz",
Port: intstr.FromInt(10259),
Scheme: v1.URISchemeHTTPS,
},
},
InitialDelaySeconds: 15,
TimeoutSeconds: 15,
},
Resources: v1.ResourceRequirements{
Requests: v1.ResourceList{
v1.ResourceCPU: apiresource.MustParse("10m"),
v1.ResourceMemory: apiresource.MustParse("64Mi"),
},
},
},
},
HostNetwork: true,
Expand Down

0 comments on commit 66b2b45

Please sign in to comment.