Skip to content

Commit

Permalink
Merge pull request #12 from KusionStack/240115-ctrlmesh
Browse files Browse the repository at this point in the history
release ctrlmesh v0.1.3-alpha.0
  • Loading branch information
Eikykun authored Jan 16, 2024
2 parents 5ddab62 + 1e2b6c9 commit 1fd620b
Show file tree
Hide file tree
Showing 25 changed files with 1,502 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/ctrlmesh
9 changes: 9 additions & 0 deletions versions/ctrlmesh/0.1.3-alpha.0/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
name: ctrlmesh
description: Helm chart for Controller-Mesh components
version: 0.1.3-alpha.0
appVersion: 0.1.3-alpha.0

home: https://KusionStack.io
sources:
- https://github.com/KusionStack/controllermesh
Empty file.
1 change: 1 addition & 0 deletions versions/ctrlmesh/0.1.3-alpha.0/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Welcome! ^_^
62 changes: 62 additions & 0 deletions versions/ctrlmesh/0.1.3-alpha.0/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "myctrlmesh.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "myctrlmesh.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "myctrlmesh.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "myctrlmesh.labels" -}}
helm.sh/chart: {{ include "myctrlmesh.chart" . }}
{{ include "myctrlmesh.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "myctrlmesh.selectorLabels" -}}
app.kubernetes.io/name: {{ include "myctrlmesh.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "myctrlmesh.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "myctrlmesh.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
8 changes: 8 additions & 0 deletions versions/ctrlmesh/0.1.3-alpha.0/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
data:
resource-config: |
{{- toYaml .Values.shardingGroupVersionKinds | nindent 4 }}
kind: ConfigMap
metadata:
name: ctrlmesh-sharding-resource
namespace: {{ .Values.namespace }}
296 changes: 296 additions & 0 deletions versions/ctrlmesh/0.1.3-alpha.0/templates/crd/circuitbreakers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,296 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.10.0
creationTimestamp: null
name: circuitbreakers.ctrlmesh.kusionstack.io
spec:
group: ctrlmesh.kusionstack.io
names:
kind: CircuitBreaker
listKind: CircuitBreakerList
plural: circuitbreakers
shortNames:
- cbk
singular: circuitbreaker
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: CircuitBreaker is the Schema for the circuitbreakers API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: CircuitBreakerSpec defines the desired state of CircuitBreaker
properties:
rateLimitings:
description: RateLimitings defines the limit policies
items:
description: Limiting defines the limit policy
properties:
bucket:
description: Bucket defines the whole token bucket of the policy
properties:
burst:
description: Burst is the max token number of the bucket
format: int32
type: integer
interval:
description: 'Interval is the time interval of the limiting
policy, in format of time like: 1h, 3m, 5s.'
type: string
limit:
description: Limit is the token number of the limiting policy.
format: int32
type: integer
required:
- burst
- interval
- limit
type: object
name:
description: Name is the name of the policy
type: string
properties:
additionalProperties:
type: string
description: 'ValidatePolicy determine the opportunity to validate
req ValidatePolicy ValidatePolicy `json:"validatePolicy,omitempty"`
Properties defines the additional properties of the policy,
like: SleepingWindowSize'
type: object
recoverPolicy:
description: RecoverPolicy defines how the circuit-breaking
policy recovered from 'Opened' to 'Closed'
properties:
sleepingWindowSize:
type: string
type:
type: string
required:
- type
type: object
resourceRules:
description: ResourceRules defines the target k8s resource of
the limiting policy
items:
description: ResourceRule defines the target k8s resource
of the limiting policy
properties:
apiGroups:
description: APIGroups is the name of the APIGroup that
contains the resources. If multiple API groups are
specified, any action requested against one of the enumerated
resources in any API group will be allowed. "*" means
all.
items:
type: string
type: array
namespaces:
description: Namespaces is a list of namespaces the rule
applies to. "*" means all.
items:
type: string
type: array
resources:
description: Resources is a list of resources this rule
applies to. "*" means all in the specified apiGroups.
"*/foo" represents the subresource 'foo' for all resources
in the specified apiGroups.
items:
type: string
type: array
verbs:
description: 'Verb is a list of kubernetes resource API
verbs, like: get, list, watch, create, update, delete,
proxy. "*" means all.'
items:
type: string
type: array
required:
- apiGroups
- namespaces
- resources
- verbs
type: object
type: array
restRules:
description: RestRules defines the target rest resource of the
limiting policy
items:
description: RestRule defines the target rest resource of
the limiting policy
properties:
method:
description: 'Method specifies the http method of the
request, like: PUT, POST, GET, DELETE.'
type: string
url:
description: URL gives the location of the rest request,
in standard URL form (`scheme://host:port/path`)
type: string
required:
- method
- url
type: object
type: array
triggerPolicy:
description: TriggerPolicy defines how the circuit-breaking
policy triggered from 'Closed' to 'Opened'
type: string
required:
- bucket
- name
- triggerPolicy
type: object
type: array
selector:
description: Selector is a label query over pods of this application.
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: A label selector requirement is a selector that
contains values, a key, and an operator that relates the key
and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship to
a set of values. Valid operators are In, NotIn, Exists
and DoesNotExist.
type: string
values:
description: values is an array of string values. If the
operator is In or NotIn, the values array must be non-empty.
If the operator is Exists or DoesNotExist, the values
array must be empty. This array is replaced during a strategic
merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator
is "In", and the values array contains only "value". The requirements
are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
trafficInterceptRules:
description: TrafficInterceptRules defines the traffic rules
items:
description: TrafficInterceptRule defines the traffic intercept
rule
properties:
contentType:
description: ContentType is the content type of the traffic
rule
type: string
contents:
description: Content is the content of the traffic rule
items:
type: string
type: array
interceptType:
description: InterceptType is the intercept type of the traffic
rule
type: string
methods:
description: 'Method specifies the http method of the request,
like: PUT, POST, GET, DELETE.'
items:
type: string
type: array
name:
description: Name is the name of the traffic rule
type: string
required:
- contentType
- contents
- interceptType
- methods
- name
type: object
type: array
required:
- selector
type: object
status:
description: CircuitBreakerStatus defines the observed state of CircuitBreaker
properties:
currentSpecHash:
type: string
lastUpdatedTime:
format: date-time
type: string
observedGeneration:
format: int64
type: integer
targetStatus:
items:
properties:
configHash:
type: string
limitingSnapshots:
items:
description: LimitingSnapshot defines the snapshot of the
whole limiting policy
properties:
lastTransitionTime:
description: LastTransitionTime is the last time that
the status changed
format: date-time
type: string
name:
description: Name specifies the name of the policy
type: string
state:
description: Status is the status of the circuit breaker,
which may be 'Opened' or 'Closed'.
type: string
required:
- name
- state
type: object
type: array
message:
type: string
podIP:
type: string
podName:
type: string
type: object
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
Loading

0 comments on commit 1fd620b

Please sign in to comment.