Merge pull request #2046 from AllenZMC/karmada_search

add health probe for karmada-search
This commit is contained in:
karmada-bot 2022-06-25 11:50:16 +08:00 committed by GitHub
commit 7d25a7275b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 8 deletions

View File

@ -46,6 +46,15 @@ spec:
- --feature-gates=APIPriorityAndFairness=false
- --audit-log-maxage=0
- --audit-log-maxbackup=0
livenessProbe:
httpGet:
path: /livez
port: 443
scheme: HTTPS
failureThreshold: 3
initialDelaySeconds: 15
periodSeconds: 15
timeoutSeconds: 5
resources:
requests:
cpu: 100m

View File

@ -66,6 +66,15 @@ spec:
- --feature-gates=APIPriorityAndFairness=false
- --audit-log-maxage=0
- --audit-log-maxbackup=0
livenessProbe:
httpGet:
path: /livez
port: 443
scheme: HTTPS
failureThreshold: 3
initialDelaySeconds: 15
periodSeconds: 15
timeoutSeconds: 5
resources:
{{- toYaml .Values.apiServer.resources | nindent 12 }}
volumes:

View File

@ -8,18 +8,19 @@ import (
"github.com/spf13/pflag"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
utilerrors "k8s.io/apimachinery/pkg/util/errors"
"k8s.io/apiserver/pkg/endpoints/openapi"
"k8s.io/apiserver/pkg/features"
genericapiserver "k8s.io/apiserver/pkg/server"
genericoptions "k8s.io/apiserver/pkg/server/options"
utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/klog/v2"
netutils "k8s.io/utils/net"
searchscheme "github.com/karmada-io/karmada/pkg/apis/search/scheme"
searchv1alpha1 "github.com/karmada-io/karmada/pkg/apis/search/v1alpha1"
generatedopenapi "github.com/karmada-io/karmada/pkg/generated/openapi"
"github.com/karmada-io/karmada/pkg/search"
"github.com/karmada-io/karmada/pkg/version"
)
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.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)
}
@ -62,15 +64,10 @@ func (o *Options) Complete() error {
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.
func (o *Options) Run(ctx context.Context) error {
klog.Infof("karmada-search version: %s", version.Get())
config, err := o.Config()
if err != nil {
return err

View File

@ -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)
}