diff --git a/ext/datasource/k8s/deploy/crds/datasource.sentinel.io_circuitbreakerrules_crd.yaml b/ext/datasource/k8s/deploy/crds/datasource.sentinel.io_circuitbreakerrules_crd.yaml new file mode 100644 index 000000000..ab561734f --- /dev/null +++ b/ext/datasource/k8s/deploy/crds/datasource.sentinel.io_circuitbreakerrules_crd.yaml @@ -0,0 +1,92 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: circuitbreakerrules.datasource.sentinel.io + namespace: default + labels: + sentinel-datasource: k8s +spec: + group: datasource.sentinel.io + names: + kind: CircuitBreakerRules + listKind: CircuitBreakerRulesList + plural: circuitbreakerrules + singular: circuitbreakerrule + shortNames: + - cbrs + scope: Namespaced + validation: + openAPIV3Schema: + description: CircuitBreakerRules is the Schema for the circuit breaker rules API + properties: + apiVersion: + description: 'Kind is a string value representing the REST resource this object represents.' + type: string + kind: + description: 'APIVersion defines the versioned schema of this representation of an object.' + type: string + metadata: + type: object + spec: + description: CircuitBreakerRulesSpec defines the desired state of CircuitBreakerRules + properties: + rules: + description: 'rules is the circuit breaker rule list' + items: + properties: + resource: + type: string + minLength: 1 + maxLength: 100 + strategy: + type: string + enum: + - SlowRequestRatio + - ErrorRatio + - ErrorCount + retryTimeoutMs: + format: int32 + type: integer + default: 1000 + minimum: 1 + minRequestAmount: + format: int64 + type: integer + default: 10 + minimum: 1 + statIntervalMs: + format: int32 + type: integer + default: 10000 + minimum: 1 + maxAllowedRtMs: + format: int64 + type: integer + minimum: 1 + maxSlowRequestRatio: + type: number + format: float + errorCountThreshold: + format: int64 + type: integer + minimum: 1 + errorRatioThreshold: + type: number + format: float + required: + - resource + - strategy + type: object + type: array + required: + - rules + type: object + status: + description: CircuitBreakerRulesStatus defines the observed state of CircuitBreakerRules + type: object + type: object + version: v1 + versions: + - name: v1 + served: true + storage: true diff --git a/ext/datasource/k8s/deploy/crds/datasource.sentinel.io_flowrules_crd.yaml b/ext/datasource/k8s/deploy/crds/datasource.sentinel.io_flowrules_crd.yaml new file mode 100644 index 000000000..1bfb926e9 --- /dev/null +++ b/ext/datasource/k8s/deploy/crds/datasource.sentinel.io_flowrules_crd.yaml @@ -0,0 +1,98 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: flowrules.datasource.sentinel.io + namespace: default + labels: + sentinel-datasource: k8s +spec: + group: datasource.sentinel.io + names: + kind: FlowRules + listKind: FlowRulesList + plural: flowrules + singular: flowrule + shortNames: + - frs + scope: Namespaced + validation: + openAPIV3Schema: + description: FlowRules is the Schema for the flowrules API + properties: + apiVersion: + description: 'Kind is a string value representing the REST resource this object represents.' + type: string + kind: + description: 'APIVersion defines the versioned schema of this representation of an object.' + type: string + metadata: + type: object + spec: + description: FlowRulesSpec defines the desired state of FlowRules + properties: + rules: + description: 'rules is the flow rule list' + items: + properties: + resource: + type: string + minLength: 1 + maxLength: 100 + limitOrigin: + type: string + minLength: 1 + maxLength: 100 + metricType: + type: string + enum: + - Concurrency + - QPS + count: + type: number + format: float + relationStrategy: + type: string + default: Direct + enum: + - Direct + - AssociatedResource + controlBehavior: + type: string + enum: + - Reject + - WarmUp + - Throttling + - WarmUpThrottling + refResource: + type: string + minLength: 1 + maxLength: 100 + warmUpPeriodSec: + format: int32 + type: integer + default: 1 + minimum: 0 + maxQueueingTimeMs: + format: int32 + type: integer + default: 10 + minimum: 0 + required: + - resource + - metricType + - count + - controlBehavior + type: object + type: array + required: + - rules + type: object + status: + description: FlowRulesStatus defines the observed state of FlowRules + type: object + type: object + version: v1 + versions: + - name: v1 + served: true + storage: true diff --git a/ext/datasource/k8s/deploy/crds/datasource.sentinel.io_hotspotrules_crd.yaml b/ext/datasource/k8s/deploy/crds/datasource.sentinel.io_hotspotrules_crd.yaml new file mode 100644 index 000000000..e44409ba5 --- /dev/null +++ b/ext/datasource/k8s/deploy/crds/datasource.sentinel.io_hotspotrules_crd.yaml @@ -0,0 +1,124 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: hotspotrules.datasource.sentinel.io + namespace: default + labels: + sentinel-datasource: k8s +spec: + group: datasource.sentinel.io + names: + kind: HotspotRules + listKind: HotspotRulesList + plural: hotspotrules + singular: hotspotrule + shortNames: + - hrs + scope: Namespaced + validation: + openAPIV3Schema: + description: HotspotRules is the Schema for the hotspotrules API + properties: + apiVersion: + description: 'Kind is a string value representing the REST resource this object represents.' + type: string + kind: + description: 'APIVersion defines the versioned schema of this representation of an object.' + type: string + metadata: + type: object + spec: + description: HotspotRulesSpec defines the desired state of HotspotRules + properties: + rules: + description: 'rules is the hot spot(frequency) rule list' + items: + properties: + resource: + type: string + minLength: 1 + maxLength: 100 + metricType: + type: string + enum: + - Concurrency + - QPS + controlBehavior: + type: string + enum: + - Reject + - Throttling + paramIndex: + description: ParamIndex is the index in context arguments list. + type: integer + minimum: 0 + threshold: + format: number + type: float + maxQueueingTimeMs: + description: MaxQueueingTimeMs is the max queueing time in Throttling ControlBehavior + format: int64 + type: integer + default: 10 + minimum: 0 + burstCount: + format: int64 + type: integer + default: 10 + minimum: 0 + durationInSec: + format: int64 + type: integer + default: 10 + minimum: 0 + paramsMaxCapacity: + format: int64 + type: integer + default: 20000 + minimum: 1 + specificItems: + description: specific item list + items: + description: 'specific item' + properties: + valKind: + format: string + enum: + - Int + - String + - Bool + - Float64 + valStr: + type: string + minLength: 1 + maxLength: 100 + specificThreshold: + format: int64 + type: integer + minimum: 0 + required: + - valKind + - valStr + - specificThreshold + type: object + type: array + required: + - resource + - metricType + - controlBehavior + - paramIndex + - threshold + type: object + type: array + required: + - rules + type: object + status: + description: HotspotRulesStatus defines the observed state of HotspotRules + type: object + type: object + version: v1 + versions: + - name: v1 + served: true + storage: true diff --git a/ext/datasource/k8s/deploy/crds/datasource.sentinel.io_systemrules_crd.yaml b/ext/datasource/k8s/deploy/crds/datasource.sentinel.io_systemrules_crd.yaml new file mode 100644 index 000000000..95a750c76 --- /dev/null +++ b/ext/datasource/k8s/deploy/crds/datasource.sentinel.io_systemrules_crd.yaml @@ -0,0 +1,70 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: systemrules.datasource.sentinel.io + namespace: default + labels: + sentinel-datasource: k8s +spec: + group: datasource.sentinel.io + names: + kind: SystemRules + listKind: SystemRulesList + plural: systemrules + singular: systemrule + shortNames: + - srs + scope: Namespaced + validation: + openAPIV3Schema: + description: SystemRules is the Schema for the systemrules API + properties: + apiVersion: + description: 'Kind is a string value representing the REST resource this object represents.' + type: string + kind: + description: 'APIVersion defines the versioned schema of this representation of an object.' + type: string + metadata: + type: object + spec: + description: SystemRulesSpec defines the desired state of SystemRules + properties: + rules: + description: 'rules is the system rule list' + items: + properties: + metricType: + type: string + enum: + - Load + - AvgRT + - Concurrency + - InboundQPS + - CpuUsage + strategy: + type: string + enum: + - NoAdaptive + - BBR + triggerCount: + type: number + format: float + required: + - metricType + - strategy + - triggerCount + type: object + type: array + required: + - rules + type: object + status: + description: SystemRulesStatus defines the observed state of SystemRules + type: object + type: object + version: v1 + versions: + - name: v1 + served: true + storage: true