Skip to content

Commit

Permalink
update .gitignore (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
rambohe-ch authored and huiwq1990 committed Apr 23, 2022
1 parent 162bf2c commit dc4f071
Show file tree
Hide file tree
Showing 52 changed files with 32,100 additions and 748 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ gopath
dockerbuild

*.out
logs
test-prow
logs
46 changes: 28 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,31 @@ generate-goclient: controller-gen
generate-deploy-yaml:
hack/make-rules/genyaml.sh

# find or download controller-gen
# download controller-gen if necessary
controller-gen:
ifeq (, $(shell which controller-gen-openyurt))
@{ \
set -e ;\
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 ;\
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.2.9 ;\
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
mv $(GOPATH)/bin/controller-gen $(GOPATH)/bin/controller-gen-openyurt ;\
}
CONTROLLER_GEN=$(GOPATH)/bin/controller-gen-openyurt
else
CONTROLLER_GEN=$(shell which controller-gen-openyurt)
endif
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
.PHONY: controller-gen
controller-gen: ## Download controller-gen locally if necessary.
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.7.0)

KUSTOMIZE = $(shell pwd)/bin/kustomize
.PHONY: kustomize
kustomize: ## Download kustomize locally if necessary.
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v3@v3.8.7)

ENVTEST = $(shell pwd)/bin/setup-envtest
.PHONY: envtest
envtest: ## Download envtest-setup locally if necessary.
$(call go-get-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@latest)

# go-get-tool will 'go get' any package $2 and install it to $1.
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
define go-get-tool
@[ -f $(1) ] || { \
set -e ;\
TMP_DIR=$$(mktemp -d) ;\
cd $$TMP_DIR ;\
go mod init tmp ;\
echo "Downloading $(2)" ;\
GOBIN=$(PROJECT_DIR)/bin go get $(2) ;\
rm -rf $$TMP_DIR ;\
}
endef
8 changes: 4 additions & 4 deletions cmd/yurt-app-manager/app/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ import (
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/leaderelection/resourcelock"
"k8s.io/klog"
"k8s.io/klog/klogr"
"k8s.io/klog/v2"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
// +kubebuilder:scaffold:imports
Expand Down Expand Up @@ -100,8 +100,8 @@ func Run(opts *options.YurtAppOptions) {
}()
}

//ctrl.SetLogger(zap.New(zap.UseDevMode(true)))
ctrl.SetLogger(klogr.New())
ctrl.SetLogger(zap.New(zap.UseDevMode(true)))
//ctrl.SetLogger(klogr.New())

cfg := ctrl.GetConfigOrDie()
setRestConfig(cfg)
Expand Down
173 changes: 173 additions & 0 deletions config/crd/bases/apps.openyurt.io_nodepools.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
name: nodepools.apps.openyurt.io
spec:
group: apps.openyurt.io
names:
categories:
- all
kind: NodePool
listKind: NodePoolList
plural: nodepools
shortNames:
- np
singular: nodepool
scope: Cluster
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
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
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.
properties:
effect:
description: Required. The effect of the taint on pods that
do not tolerate the taint. Valid effects are NoSchedule, PreferNoSchedule
and NoExecute.
type: string
key:
description: Required. The taint key to be applied to a node.
type: string
timeAdded:
description: TimeAdded represents the time at which the taint
was added. It is only written for NoExecute taints.
format: date-time
type: string
value:
description: The taint value corresponding to the taint key.
type: string
required:
- effect
- key
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:
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: ""
plural: ""
conditions: []
storedVersions: []
Loading

0 comments on commit dc4f071

Please sign in to comment.