Skip to content

Conversation

@ant31
Copy link
Contributor

@ant31 ant31 commented Feb 24, 2020

related to #166

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 24, 2020
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 24, 2020
@barney-s
Copy link
Contributor

needs rebase

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 25, 2020
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 26, 2020
Makefile Outdated
# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
.PHONY: deploy
deploy: $(TOOLBIN)/kustomize
deploy: $(TOOLBIN)/kustomize update-version
Copy link
Contributor

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 -
Copy link
Contributor

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
Copy link
Contributor

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.

kubernetes-sigs/kustomize#388
@Liujingfang1 FYI

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.

Copy link
Contributor

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

Copy link
Contributor Author

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:
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

system ?

@barney-s
Copy link
Contributor

/assign @barney-s

commonLabels:
control-plane: kube-app-manager
app.kubernetes.io/name: kube-app-manager
app.kubernetes.io/version: dev

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.

Copy link
Contributor Author

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.

@barney-s
Copy link
Contributor

@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.

@barney-s
Copy link
Contributor

barney-s commented Mar 5, 2020

@ant31 - Would you please address the review comments. Let us know when we can review again.

@ant31
Copy link
Contributor Author

ant31 commented Mar 7, 2020

I went through the previous comments.

  • created overlay per version (instead of using 'sed')
  • directly use the aoi file in the make (un)deploy targets)
  • removed the version from common labels

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 -
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@ant31
Copy link
Contributor Author

ant31 commented Mar 10, 2020

@barney-s it's ready for a second pass.
Also, unless there's some additional blockers, I suggest to merge and I'll address remaining comment promptly in a followup PR, it will be easier to review small changes than re-review on this large PR.

@barney-s
Copy link
Contributor

/approve
/lgtm

Thanks @ant31

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 11, 2020
@k8s-ci-robot
Copy link
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit c9672ae into kubernetes-sigs:master Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants