-
Notifications
You must be signed in to change notification settings - Fork 180
Create all-in-one file to deploy kube-app-manager #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
needs rebase |
Makefile
Outdated
| # Deploy controller in the configured Kubernetes cluster in ~/.kube/config | ||
| .PHONY: deploy | ||
| deploy: $(TOOLBIN)/kustomize | ||
| deploy: $(TOOLBIN)/kustomize update-version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use generate-resource as a make dependency
Makefile
Outdated
| deploy: $(TOOLBIN)/kustomize | ||
| deploy: $(TOOLBIN)/kustomize update-version | ||
| cd config/kube-app-manager && $(TOOLBIN)/kustomize edit set image controller=$(CONTROLLER_IMG) | ||
| $(TOOLBIN)/kustomize build config/default | $(TOOLBIN)/kubectl apply -f - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use kubectl apply -f deploy/kube-app-manager...
Makefile
Outdated
|
|
||
| .PHONY: update-version | ||
| update-version: | ||
| sed -i '' "s|app.kubernetes.io/version: dev|app.kubernetes.io/version: $(VERSION)|g" config/default/kustomization.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems like an anti-pattern. and not sure if there is a better way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A better way of doing this is to create a new kustomization target for that version. For example, use config/v1.0.0 directory for the version v1.0.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your recommendation @Liujingfang1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can try this way(new kustomization target) as suggested, and discuss later if it becomes too much work
| resources: | ||
| - manager.yaml | ||
|
|
||
| images: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this may not be needed since we use kustomize set image in makefile
| kind: Deployment | ||
| metadata: | ||
| name: controller | ||
| namespace: syste m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
system ?
|
/assign @barney-s |
config/default/kustomization.yaml
Outdated
| commonLabels: | ||
| control-plane: kube-app-manager | ||
| app.kubernetes.io/name: kube-app-manager | ||
| app.kubernetes.io/version: dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't add app.kubernetes.io/version: dev as a commonLabel. The commonLabel added here will be injected to the labelSelector of the StatefulSet for the manager. It will cause trouble when you update the manager to a different version.
Suggest to add it in the commonAnnotation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thank you !
app.kubernetes.io/version is one of the 5-6 recommended label as suggested by the kubernetes.io documentation.
I’m removing it, but I think it could also be a potential improvement of kustomize: not all labels are there for label selection, some are used for filtering/indexing/operator management.
I’ll open an issue on kustomize repo to followup on this.
|
@ant31 - thanks for this change. once it is merged iam thinking we could generate a release artifact that includes the all-in-one deploy yaml. |
|
@ant31 - Would you please address the review comments. Let us know when we can review again. |
|
I went through the previous comments.
for now I keep the image on quay, next week I ll look at moving it to k8s. gcr. io Thank you for the review |
| .PHONY: install | ||
| install: $(TOOLBIN)/kustomize $(TOOLBIN)/kubectl | ||
| deploy-crd: $(TOOLBIN)/kustomize $(TOOLBIN)/kubectl | ||
| $(TOOLBIN)/kustomize build config/crd| $(TOOLBIN)/kubectl apply -f - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
install vs deploy wording is confusing in kubernetes ecosystem . Especially in this case when it's a substep of the whole deployment.
Renamed it in deploy-crd
|
|
||
| .PHONY: docker-build | ||
| docker-build: test $(TOOLBIN)/kustomize ## Build the docker image for kube-app-manager | ||
| docker-build: set-image test $(TOOLBIN)/kustomize ## Build the docker image for kube-app-manager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Image is set only when it's a custom image, otherwise it's already configured in the versions overlay
|
@barney-s it's ready for a second pass. |
|
/approve Thanks @ant31 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ant31, barney-s The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
related to #166