@@ -172,6 +172,8 @@ func addWebService(c *restful.Container) error {
|
||||
Consumes(restful.MIME_JSON, restful.MIME_XML).
|
||||
Produces(restful.MIME_JSON)
|
||||
|
||||
// Only use this api to monitor status of pods under the {workload}
|
||||
// To monitor a specific workload, try the next two apis with "resources_filter"
|
||||
ws.Route(ws.GET("/namespaces/{namespace}/workloads/{workload_kind}/{workload}").To(monitoring.MonitorWorkload).
|
||||
Doc("monitor specific workload level metrics").
|
||||
Param(ws.PathParameter("namespace", "namespace").DataType("string").Required(true).DefaultValue("kube-system")).
|
||||
@@ -188,6 +190,21 @@ func addWebService(c *restful.Container) error {
|
||||
Consumes(restful.MIME_JSON, restful.MIME_XML).
|
||||
Produces(restful.MIME_JSON)
|
||||
|
||||
ws.Route(ws.GET("/namespaces/{namespace}/workloads/{workload_kind}").To(monitoring.MonitorWorkload).
|
||||
Doc("monitor specific workload kind level metrics").
|
||||
Param(ws.PathParameter("namespace", "namespace").DataType("string").Required(true).DefaultValue("kube-system")).
|
||||
Param(ws.PathParameter("workload_kind", "workload kind").DataType("string").Required(true).DefaultValue("daemonset")).
|
||||
Param(ws.QueryParameter("metrics_filter", "metrics name cpu memory...").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("resources_filter", "pod re2 expression filter").DataType("string").Required(false).DefaultValue("openpitrix.*")).
|
||||
Param(ws.QueryParameter("sort_metric", "sort metric").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("sort_type", "ascending descending order").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("page", "page number").DataType("string").Required(false).DefaultValue("1")).
|
||||
Param(ws.QueryParameter("limit", "max metric items in a page").DataType("string").Required(false).DefaultValue("4")).
|
||||
Param(ws.QueryParameter("type", "rank, statistic").DataType("string").Required(false).DefaultValue("rank")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, tags)).
|
||||
Consumes(restful.MIME_JSON, restful.MIME_XML).
|
||||
Produces(restful.MIME_JSON)
|
||||
|
||||
ws.Route(ws.GET("/namespaces/{namespace}/workloads").To(monitoring.MonitorWorkload).
|
||||
Doc("monitor all workload level metrics").
|
||||
Param(ws.PathParameter("namespace", "namespace").DataType("string").Required(true).DefaultValue("kube-system")).
|
||||
|
||||
@@ -24,6 +24,7 @@ import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"kubesphere.io/kubesphere/pkg/apiserver/components"
|
||||
"kubesphere.io/kubesphere/pkg/apiserver/git"
|
||||
"kubesphere.io/kubesphere/pkg/apiserver/quotas"
|
||||
"kubesphere.io/kubesphere/pkg/apiserver/registries"
|
||||
"kubesphere.io/kubesphere/pkg/apiserver/resources"
|
||||
@@ -33,6 +34,7 @@ import (
|
||||
"kubesphere.io/kubesphere/pkg/apiserver/workloadstatuses"
|
||||
"kubesphere.io/kubesphere/pkg/errors"
|
||||
"kubesphere.io/kubesphere/pkg/models"
|
||||
gitmodel "kubesphere.io/kubesphere/pkg/models/git"
|
||||
"kubesphere.io/kubesphere/pkg/params"
|
||||
)
|
||||
|
||||
@@ -165,6 +167,15 @@ func addWebService(c *restful.Container) error {
|
||||
Doc("docker registry verify").
|
||||
Writes(errors.Error{}))
|
||||
|
||||
tags = []string{"Git"}
|
||||
webservice.Route(webservice.POST("/git/readverify").
|
||||
To(
|
||||
git.GitReadVerify).
|
||||
Metadata(restfulspec.KeyOpenAPITags, tags).
|
||||
Doc("secret git read verify").
|
||||
Reads(gitmodel.AuthInfo{}).
|
||||
Writes(errors.Error{}),
|
||||
)
|
||||
tags = []string{"Revision"}
|
||||
|
||||
webservice.Route(webservice.GET("/namespaces/{namespace}/daemonsets/{daemonset}/revisions/{revision}").
|
||||
|
||||
@@ -28,7 +28,6 @@ import (
|
||||
type StrategyType string
|
||||
|
||||
const (
|
||||
|
||||
// Canary strategy type
|
||||
CanaryType StrategyType = "Canary"
|
||||
|
||||
@@ -39,9 +38,21 @@ const (
|
||||
Mirror StrategyType = "Mirror"
|
||||
)
|
||||
|
||||
type StrategyPolicy string
|
||||
|
||||
const (
|
||||
// apply strategy only until workload is ready
|
||||
PolicyWaitForWorkloadReady StrategyPolicy = "WaitForWorkloadReady"
|
||||
|
||||
// apply strategy immediately no matter workload status is
|
||||
PolicyImmediately StrategyPolicy = "Immediately"
|
||||
|
||||
// pause strategy
|
||||
PolicyPause StrategyPolicy = "Paused"
|
||||
)
|
||||
|
||||
// StrategySpec defines the desired state of Strategy
|
||||
type StrategySpec struct {
|
||||
|
||||
// Strategy type
|
||||
Type StrategyType `json:"type,omitempty"`
|
||||
|
||||
@@ -62,9 +73,9 @@ type StrategySpec struct {
|
||||
// Template describes the virtual service that will be created.
|
||||
Template VirtualServiceTemplateSpec `json:"template,omitempty"`
|
||||
|
||||
// Indicates that the strategy is paused and will not be processed
|
||||
// strategy policy, how the strategy will be applied
|
||||
// by the strategy controller
|
||||
Paused bool `json:"paused,omitempty"`
|
||||
StrategyPolicy StrategyPolicy `json:"strategyPolicy,omitempty"`
|
||||
}
|
||||
|
||||
// VirtualServiceTemplateSpec
|
||||
|
||||
Reference in New Issue
Block a user