Skip to content

Commit

Permalink
init controller webhook and informer
Browse files Browse the repository at this point in the history
Signed-off-by: ii2day <[email protected]>
  • Loading branch information
ii2day committed Feb 22, 2024
1 parent 2f496aa commit 9a9f914
Show file tree
Hide file tree
Showing 59 changed files with 2,544 additions and 1,303 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ echo "Build Image $(IMAGE_NAME):$(IMAGE_TAG)" ; \
--build-arg GIT_COMMIT_VERSION=$(GIT_COMMIT_VERSION) \
--build-arg GIT_COMMIT_TIME=$(GIT_COMMIT_TIME) \
--build-arg VERSION=$(GIT_COMMIT_VERSION) \
--build-arg BUILDPLATFORM="linux/$(TARGETARCH)" \
--build-arg TARGETPLATFORM="linux/$(TARGETARCH)" \
--build-arg TARGETARCH=$(TARGETARCH) \
--build-arg BUILDPLATFORM="linux/$(ARCH)" \
--build-arg TARGETPLATFORM="linux/$(ARCH)" \
--build-arg TARGETARCH=$(ARCH) \
--build-arg TARGETOS=linux \
--file $(DOCKERFILE_PATH) \
--tag ${IMAGE_NAME}:$(IMAGE_TAG) . ; \
Expand Down Expand Up @@ -92,9 +92,9 @@ IMAGE_DIR=` dirname $(DOCKERFILE_PATH) ` ; \
echo "Build base image $(BASE_IMAGE_NAME):$${TAG}" ; \
docker build \
--build-arg USE_PROXY_SOURCE=true \
--build-arg TARGETPLATFORM="linux/$(TARGETARCH)" \
--build-arg BUILDPLATFORM="linux/$(TARGETARCH)" \
--build-arg TARGETARCH=$(TARGETARCH) \
--build-arg TARGETPLATFORM="linux/$(ARCH)" \
--build-arg BUILDPLATFORM="linux/$(ARCH)" \
--build-arg TARGETARCH=$(ARCH) \
--build-arg TARGETOS=linux \
--file $(DOCKERFILE_PATH) \
--output type=docker \
Expand Down
75 changes: 75 additions & 0 deletions charts/crds/koffloader.koffloader.io_kclustergroups.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: (unknown)
creationTimestamp: null
name: kclustergroups.koffloader.koffloader.io
spec:
group: koffloader.koffloader.io
names:
categories:
- koffloader
kind: KClusterGroup
listKind: KClusterGroupList
plural: kclustergroups
shortNames:
- kcg
singular: kclustergroup
scope: Cluster
versions:
- additionalPrinterColumns:
- description: clusterConnectorType
jsonPath: .spec.clusterConnectorType
name: clusterConnectorType
type: string
name: v1beta1
schema:
openAPIV3Schema:
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:
properties:
clusterConnector:
properties:
ciliumNamespace:
type: string
type:
type: string
type: object
kubeconfig:
properties:
secretName:
type: string
secretNamespace:
type: string
type: object
type: object
status:
properties:
clusterConnector:
type: string
kClusterGroup:
type: string
required:
- kClusterGroup
type: object
required:
- metadata
type: object
served: true
storage: true
subresources:
status: {}
156 changes: 24 additions & 132 deletions charts/crds/koffloader.koffloader.io_kclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,24 @@ spec:
names:
categories:
- koffloader
kind: Kcluster
listKind: KclusterList
kind: KCluster
listKind: KClusterList
plural: kclusters
shortNames:
- mb
- kc
singular: kcluster
scope: Cluster
versions:
- additionalPrinterColumns:
- description: ipVersion
jsonPath: .spec.ipVersion
name: VERSION
- description: clusterConnector
jsonPath: .spec.clusterConnector.type
name: clusterConnector
type: string
- description: subnet
jsonPath: .spec.subnet
name: SUBNET
- description: kClusterGroup
jsonPath: .status.kClusterGroup
name: kClusterGroup
type: string
- description: totalIPCount
jsonPath: .status.totalIPCount
name: TOTAL-IP-COUNT
type: integer
name: v1
name: v1beta1
schema:
openAPIV3Schema:
properties:
Expand All @@ -50,133 +46,29 @@ spec:
type: object
spec:
properties:
disable:
default: false
type: boolean
ipVersion:
enum:
- 4
- 6
format: int64
type: integer
nodeAffinity:
description: A label selector is a label query over a set of resources.
The result of matchLabels and matchExpressions are ANDed. An empty
label selector matches all objects. A null label selector matches
no objects.
clusterConnector:
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
ciliumNamespace:
type: string
type:
type: string
type: object
x-kubernetes-map-type: atomic
podAffinity:
description: A label selector is a label query over a set of resources.
The result of matchLabels and matchExpressions are ANDed. An empty
label selector matches all objects. A null label selector matches
no objects.
kubeconfig:
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
secretName:
type: string
secretNamespace:
type: string
type: object
x-kubernetes-map-type: atomic
subnet:
type: string
vlan:
default: 0
format: int64
maximum: 4095
minimum: 0
type: integer
required:
- subnet
type: object
status:
properties:
timeStamp:
format: date-time
clusterConnector:
type: string
kClusterGroup:
type: string
totalIPCount:
format: int64
minimum: 0
type: integer
required:
- totalIPCount
- kClusterGroup
type: object
required:
- metadata
Expand Down
70 changes: 70 additions & 0 deletions charts/crds/koffloader.koffloader.io_serviceexportpolicies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: (unknown)
creationTimestamp: null
name: serviceexportpolicies.koffloader.koffloader.io
spec:
group: koffloader.koffloader.io
names:
categories:
- koffloader
kind: ServiceExportPolicy
listKind: ServiceExportPolicyList
plural: serviceexportpolicies
shortNames:
- sep
singular: serviceexportpolicy
scope: Cluster
versions:
- name: v1beta1
schema:
openAPIV3Schema:
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:
properties:
clusterConnector:
properties:
ciliumNamespace:
type: string
type:
type: string
type: object
kubeconfig:
properties:
secretName:
type: string
secretNamespace:
type: string
type: object
type: object
status:
properties:
clusterConnector:
type: string
kClusterGroup:
type: string
required:
- kClusterGroup
type: object
required:
- metadata
type: object
served: true
storage: true
subresources:
status: {}
Loading

0 comments on commit 9a9f914

Please sign in to comment.