Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
戎 润祥
CRD
Commits
24ef3629
Commit
24ef3629
authored
Jul 31, 2022
by
宝俊 黄
Browse files
modify Makefile
parent
6f32f3d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
24ef3629
...
...
@@ -2,6 +2,7 @@
# Image URL to use all building/pushing image targets
IMG
?=
controller:latest
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
# CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false"
CRD_OPTIONS
?=
"crd"
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
...
...
@@ -37,10 +38,12 @@ help: ## Display this help.
##@ Development
manifests
:
controller-gen
##
Generate WebhookConfiguration
,
ClusterRole and CustomResourceDefinition objects.
# manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
manifests
:
$(CONTROLLER_GEN)
$(CRD_OPTIONS)
rbac:roleName
=
manager-role webhook
paths
=
"./..."
output:crd:artifacts:config
=
config/crd/bases
generate
:
controller-gen
##
Generate code containing DeepCopy
,
DeepCopyInto
,
and DeepCopyObject method implementations.
# generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
generate
:
$(CONTROLLER_GEN)
object:headerFile
=
"hack/boilerplate.go.txt"
paths
=
"./..."
fmt
:
##
Run go fmt against code.
...
...
@@ -63,7 +66,7 @@ build: generate fmt vet ## Build manager binary.
run
:
manifests generate fmt vet
##
Run a controller from your host.
go run ./main.go
docker-build
:
test
##
Build docker image with the manager.
docker-build
:
##
Build docker image with the manager.
docker build
-t
${IMG}
.
docker-push
:
##
Push docker image with the manager.
...
...
@@ -71,25 +74,28 @@ docker-push: ## Push docker image with the manager.
##@ Deployment
install
:
manifests kustomize
##
Install CRDs into the K8s cluster specified in ~/.kube/config.
# install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
install
:
manifests
$(KUSTOMIZE)
build config/crd | kubectl apply
-f
-
uninstall
:
manifests kustomize
##
Uninstall CRDs from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE)
build config/crd | kubectl delete
-f
-
deploy
:
manifests kustomize
##
Deploy controller to the K8s cluster specified in ~/.kube/config.
cd
config/manager
&&
$(KUSTOMIZE)
edit
set
image
controller
=
${IMG}
# deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
deploy
:
manifests
cd
config/manager
&&
$(KUSTOMIZE_1)
edit
set
image
controller
=
${IMG}
&&
cd
../..
$(KUSTOMIZE)
build config/default | kubectl apply
-f
-
undeploy
:
##
Undeploy controller from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE)
build config/default | kubectl delete
-f
-
CONTROLLER_GEN
=
controller-gen
CONTROLLER_GEN
=
./
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.4.1
)
KUSTOMIZE
=
kustomize
KUSTOMIZE
=
./kustomize
KUSTOMIZE_1
=
../../kustomize
kustomize
:
##
Download kustomize locally if necessary.
$(
call
go-get-tool,
$(KUSTOMIZE)
,sigs.k8s.io/kustomize/kustomize/v3@v3.8.7
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment