Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

Commit

Permalink
feature: support k8s v1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
adamzhoul committed Jun 2, 2022
1 parent 917fb6c commit 8254486
Show file tree
Hide file tree
Showing 20 changed files with 1,448 additions and 1,339 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ generate: controller-gen generate-manifests generate-goclient

# Generate manifests, e.g., CRD, RBAC etc.
generate-manifests: controller-gen
$(CONTROLLER_GEN) crd:trivialVersions=true rbac:roleName=manager-role webhook paths="./pkg/yurtappmanager/..." output:crd:artifacts:config=config/yurt-app-manager/crd/bases output:rbac:artifacts:config=config/yurt-app-manager/rbac output:webhook:artifacts:config=config/yurt-app-manager/webhook
$(CONTROLLER_GEN) crd:trivialVersions=true,crdVersions=v1 rbac:roleName=manager-role webhook paths="./pkg/yurtappmanager/..." output:crd:artifacts:config=config/yurt-app-manager/crd/bases output:rbac:artifacts:config=config/yurt-app-manager/rbac output:webhook:artifacts:config=config/yurt-app-manager/webhook

# Generate go codes.
generate-goclient: controller-gen
Expand Down Expand Up @@ -108,7 +108,7 @@ ifeq (, $(shell which controller-gen-openyurt))
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
cd $$CONTROLLER_GEN_TMP_DIR ;\
go mod init tmp ;\
echo "replace sigs.k8s.io/controller-tools => github.com/openkruise/controller-tools v0.2.9-kruise" >> go.mod ;\
echo "replace sigs.k8s.io/controller-tools => github.com/openkruise/controller-tools v0.5.0-kruise-beta.3" >> go.mod ;\
go get sigs.k8s.io/controller-tools/cmd/[email protected] ;\
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
mv $(GOPATH)/bin/controller-gen $(GOPATH)/bin/controller-gen-openyurt ;\
Expand Down
1,358 changes: 786 additions & 572 deletions config/setup/all_in_one.yaml

Large diffs are not rendered by default.

221 changes: 100 additions & 121 deletions config/yurt-app-manager/crd/bases/apps.openyurt.io_nodepools.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@

---
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.9
creationTimestamp: null
name: nodepools.apps.openyurt.io
spec:
additionalPrinterColumns:
- JSONPath: .spec.type
description: The type of nodepool
name: Type
type: string
- JSONPath: .status.readyNodeNum
description: The number of ready nodes in the pool
name: ReadyNodes
type: integer
- JSONPath: .status.unreadyNodeNum
name: NotReadyNodes
type: integer
- JSONPath: .metadata.creationTimestamp
name: Age
type: date
group: apps.openyurt.io
names:
categories:
Expand All @@ -34,117 +19,111 @@ spec:
- np
singular: nodepool
scope: Cluster
subresources:
status: {}
validation:
openAPIV3Schema:
description: NodePool is the Schema for the nodepools 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: NodePoolSpec defines the desired state of NodePool
properties:
annotations:
additionalProperties:
type: string
description: 'If specified, the Annotations will be added to all nodes.
NOTE: existing labels with samy keys on the nodes will be overwritten.'
type: object
labels:
additionalProperties:
type: string
description: 'If specified, the Labels will be added to all nodes. NOTE:
existing labels with samy keys on the nodes will be overwritten.'
type: object
selector:
description: A label query over nodes to consider for adding to the
pool
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:
versions:
- additionalPrinterColumns:
- description: The type of nodepool
jsonPath: .spec.type
name: Type
type: string
- description: The number of ready nodes in the pool
jsonPath: .status.readyNodeNum
name: ReadyNodes
type: integer
- jsonPath: .status.unreadyNodeNum
name: NotReadyNodes
type: integer
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: NodePool is the Schema for the nodepools 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: NodePoolSpec defines the desired state of NodePool
properties:
annotations:
additionalProperties:
type: string
description: 'If specified, the Annotations will be added to all nodes. NOTE: existing labels with samy keys on the nodes will be overwritten.'
type: object
labels:
additionalProperties:
type: string
description: 'If specified, the Labels will be added to all nodes. NOTE: existing labels with samy keys on the nodes will be overwritten.'
type: object
selector:
description: A label query over nodes to consider for adding to the pool
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
type: array
required:
- key
- operator
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: 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
taints:
description: If specified, the Taints will be added to all nodes.
items:
description: The node this Taint is attached to has the "effect" on
any pod that does not tolerate the Taint.
type: object
type: array
type:
description: The type of the NodePool
type: string
type: object
status:
description: NodePoolStatus defines the observed state of NodePool
properties:
nodes:
description: The list of nodes' names in the pool
items:
taints:
description: If specified, the Taints will be added to all nodes.
items:
description: The node this Taint is attached to has the "effect" on any pod that does not tolerate the Taint.
type: object
x-kubernetes-preserve-unknown-fields: true
type: array
type:
description: The type of the NodePool
type: string
type: array
readyNodeNum:
description: Total number of ready nodes in the pool.
format: int32
type: integer
unreadyNodeNum:
description: Total number of unready nodes in the pool.
format: int32
type: integer
type: object
type: object
version: v1alpha1
versions:
- name: v1alpha1
type: object
status:
description: NodePoolStatus defines the observed state of NodePool
properties:
nodes:
description: The list of nodes' names in the pool
items:
type: string
type: array
readyNodeNum:
description: Total number of ready nodes in the pool.
format: int32
type: integer
unreadyNodeNum:
description: Total number of unready nodes in the pool.
format: int32
type: integer
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
Expand Down
Loading

0 comments on commit 8254486

Please sign in to comment.