Merge pull request #2046 from AllenZMC/karmada_search
add health probe for karmada-search
This commit is contained in:
commit
7d25a7275b
|
@ -46,6 +46,15 @@ spec:
|
||||||
- --feature-gates=APIPriorityAndFairness=false
|
- --feature-gates=APIPriorityAndFairness=false
|
||||||
- --audit-log-maxage=0
|
- --audit-log-maxage=0
|
||||||
- --audit-log-maxbackup=0
|
- --audit-log-maxbackup=0
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /livez
|
||||||
|
port: 443
|
||||||
|
scheme: HTTPS
|
||||||
|
failureThreshold: 3
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
periodSeconds: 15
|
||||||
|
timeoutSeconds: 5
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
|
|
|
@ -66,6 +66,15 @@ spec:
|
||||||
- --feature-gates=APIPriorityAndFairness=false
|
- --feature-gates=APIPriorityAndFairness=false
|
||||||
- --audit-log-maxage=0
|
- --audit-log-maxage=0
|
||||||
- --audit-log-maxbackup=0
|
- --audit-log-maxbackup=0
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /livez
|
||||||
|
port: 443
|
||||||
|
scheme: HTTPS
|
||||||
|
failureThreshold: 3
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
periodSeconds: 15
|
||||||
|
timeoutSeconds: 5
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.apiServer.resources | nindent 12 }}
|
{{- toYaml .Values.apiServer.resources | nindent 12 }}
|
||||||
volumes:
|
volumes:
|
||||||
|
|
|
@ -8,18 +8,19 @@ import (
|
||||||
"github.com/spf13/pflag"
|
"github.com/spf13/pflag"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
utilerrors "k8s.io/apimachinery/pkg/util/errors"
|
|
||||||
"k8s.io/apiserver/pkg/endpoints/openapi"
|
"k8s.io/apiserver/pkg/endpoints/openapi"
|
||||||
"k8s.io/apiserver/pkg/features"
|
"k8s.io/apiserver/pkg/features"
|
||||||
genericapiserver "k8s.io/apiserver/pkg/server"
|
genericapiserver "k8s.io/apiserver/pkg/server"
|
||||||
genericoptions "k8s.io/apiserver/pkg/server/options"
|
genericoptions "k8s.io/apiserver/pkg/server/options"
|
||||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||||
|
"k8s.io/klog/v2"
|
||||||
netutils "k8s.io/utils/net"
|
netutils "k8s.io/utils/net"
|
||||||
|
|
||||||
searchscheme "github.com/karmada-io/karmada/pkg/apis/search/scheme"
|
searchscheme "github.com/karmada-io/karmada/pkg/apis/search/scheme"
|
||||||
searchv1alpha1 "github.com/karmada-io/karmada/pkg/apis/search/v1alpha1"
|
searchv1alpha1 "github.com/karmada-io/karmada/pkg/apis/search/v1alpha1"
|
||||||
generatedopenapi "github.com/karmada-io/karmada/pkg/generated/openapi"
|
generatedopenapi "github.com/karmada-io/karmada/pkg/generated/openapi"
|
||||||
"github.com/karmada-io/karmada/pkg/search"
|
"github.com/karmada-io/karmada/pkg/search"
|
||||||
|
"github.com/karmada-io/karmada/pkg/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultEtcdPathPrefix = "/registry"
|
const defaultEtcdPathPrefix = "/registry"
|
||||||
|
@ -54,6 +55,7 @@ func (o *Options) AddFlags(flags *pflag.FlagSet) {
|
||||||
|
|
||||||
flags.Float32Var(&o.KubeAPIQPS, "kube-api-qps", 40.0, "QPS to use while talking with karmada-apiserver. Doesn't cover events and node heartbeat apis which rate limiting is controlled by a different set of flags.")
|
flags.Float32Var(&o.KubeAPIQPS, "kube-api-qps", 40.0, "QPS to use while talking with karmada-apiserver. Doesn't cover events and node heartbeat apis which rate limiting is controlled by a different set of flags.")
|
||||||
flags.IntVar(&o.KubeAPIBurst, "kube-api-burst", 60, "Burst to use while talking with karmada-apiserver. Doesn't cover events and node heartbeat apis which rate limiting is controlled by a different set of flags.")
|
flags.IntVar(&o.KubeAPIBurst, "kube-api-burst", 60, "Burst to use while talking with karmada-apiserver. Doesn't cover events and node heartbeat apis which rate limiting is controlled by a different set of flags.")
|
||||||
|
|
||||||
utilfeature.DefaultMutableFeatureGate.AddFlag(flags)
|
utilfeature.DefaultMutableFeatureGate.AddFlag(flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,15 +64,10 @@ func (o *Options) Complete() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates Options.
|
|
||||||
func (o *Options) Validate() error {
|
|
||||||
var errs []error
|
|
||||||
errs = append(errs, o.RecommendedOptions.Validate()...)
|
|
||||||
return utilerrors.NewAggregate(errs)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Run runs the aggregated-apiserver with options. This should never exit.
|
// Run runs the aggregated-apiserver with options. This should never exit.
|
||||||
func (o *Options) Run(ctx context.Context) error {
|
func (o *Options) Run(ctx context.Context) error {
|
||||||
|
klog.Infof("karmada-search version: %s", version.Get())
|
||||||
|
|
||||||
config, err := o.Config()
|
config, err := o.Config()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
package options
|
||||||
|
|
||||||
|
import (
|
||||||
|
utilerrors "k8s.io/apimachinery/pkg/util/errors"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Validate validates Options.
|
||||||
|
func (o *Options) Validate() error {
|
||||||
|
var errs []error
|
||||||
|
errs = append(errs, o.RecommendedOptions.Validate()...)
|
||||||
|
|
||||||
|
return utilerrors.NewAggregate(errs)
|
||||||
|
}
|
Loading…
Reference in New Issue