mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-15 07:05:27 +00:00
Decreased API server boot time (#536)
This commit is contained in:
parent
90c210452d
commit
f266f32fea
@ -5,6 +5,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"k8s.io/apimachinery/pkg/util/intstr"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@ -128,6 +129,7 @@ func RunMizuTap() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.Log.Infof("Waiting for Mizu Agent to start...")
|
||||||
if err := createMizuResources(ctx, cancel, kubernetesProvider, serializedValidationRules, serializedContract, serializedMizuConfig); err != nil {
|
if err := createMizuResources(ctx, cancel, kubernetesProvider, serializedValidationRules, serializedContract, serializedMizuConfig); err != nil {
|
||||||
logger.Log.Errorf(uiUtils.Error, fmt.Sprintf("Error creating resources: %v", errormessage.FormatError(err)))
|
logger.Log.Errorf(uiUtils.Error, fmt.Sprintf("Error creating resources: %v", errormessage.FormatError(err)))
|
||||||
|
|
||||||
@ -382,7 +384,16 @@ func createMizuApiServerDeployment(ctx context.Context, kubernetesProvider *kube
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
pod.Spec.Containers[0].LivenessProbe = &core.Probe{
|
||||||
|
Handler: core.Handler{
|
||||||
|
HTTPGet: &core.HTTPGetAction{
|
||||||
|
Path: "/echo",
|
||||||
|
Port: intstr.FromInt(shared.DefaultApiServerPort),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
InitialDelaySeconds: 1,
|
||||||
|
PeriodSeconds: 10,
|
||||||
|
}
|
||||||
if _, err = kubernetesProvider.CreateDeployment(ctx, config.Config.MizuResourcesNamespace, opts.PodName, pod); err != nil {
|
if _, err = kubernetesProvider.CreateDeployment(ctx, config.Config.MizuResourcesNamespace, opts.PodName, pod); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -240,8 +240,6 @@ func (provider *Provider) GetMizuApiServerPodObject(opts *ApiServerOptions, moun
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
port := intstr.FromInt(shared.DefaultApiServerPort)
|
|
||||||
|
|
||||||
pod := &core.Pod{
|
pod := &core.Pod{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: opts.PodName,
|
Name: opts.PodName,
|
||||||
@ -275,25 +273,6 @@ func (provider *Provider) GetMizuApiServerPodObject(opts *ApiServerOptions, moun
|
|||||||
"memory": memRequests,
|
"memory": memRequests,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ReadinessProbe: &core.Probe{
|
|
||||||
Handler: core.Handler{
|
|
||||||
TCPSocket: &core.TCPSocketAction{
|
|
||||||
Port: port,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
InitialDelaySeconds: 5,
|
|
||||||
PeriodSeconds: 10,
|
|
||||||
},
|
|
||||||
LivenessProbe: &core.Probe{
|
|
||||||
Handler: core.Handler{
|
|
||||||
HTTPGet: &core.HTTPGetAction{
|
|
||||||
Path: "/echo",
|
|
||||||
Port: port,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
InitialDelaySeconds: 5,
|
|
||||||
PeriodSeconds: 10,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Volumes: volumes,
|
Volumes: volumes,
|
||||||
|
Loading…
Reference in New Issue
Block a user