Skip to content
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

[ISSUE #196] Fix serviceAccountName inconsistency #197

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/rocketmq-operator/templates/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
labels:
name: rocketmq-operator
spec:
serviceAccountName: rocketmq-operator
serviceAccountName: {{ template "rocketmq-operator.serviceAccountName" . }}
Copy link
Contributor

Choose a reason for hiding this comment

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

This file is copied from that one in deploy directory(see the link below), pls also change the original file.
https://github.com/apache/rocketmq-operator/blob/a8665716c8028741ec106814798e39fe07e6dcaa/Makefile#L78C1-L88

Copy link
Author

Choose a reason for hiding this comment

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

Sure, I'll go through it once I have time. Please bear with me for a couple of days.

terminationGracePeriodSeconds: 10
containers:
- name: manager
Expand Down
2 changes: 1 addition & 1 deletion deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
labels:
name: rocketmq-operator
spec:
serviceAccountName: rocketmq-operator
serviceAccountName: {{ template "rocketmq-operator.serviceAccountName" . }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Files in deploy directory are for deploying by kubectl instead of helm, so templating is not supported.
@drivebyer Pls also take a look, it seems some substitution operations should be added in make manifest.

Copy link
Author

Choose a reason for hiding this comment

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

Sure!

Copy link
Contributor

Choose a reason for hiding this comment

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

For now, After we execute make manifest , the templating in chart directory disappeared.

I would find some way to do substitution in make manifest.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can generate chart by helmify, #212

Copy link
Author

@sinloss sinloss Jan 30, 2024

Choose a reason for hiding this comment

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

Finally got some time for this one. So basically, if I understand it right, and correct me if I'm not, that those yaml files in the deploy directory don't just serve one purpose which is to be copied to the templates directory, they are also being used directly by the kubectl command.

And to fix what I want to fix, something needs to be done in the make manifest process to properly generate / or recreate / or substitute after copying / or any other ways possible yaml files with helm templating contents in the templates directory while at the same time keep yaml files in the deploy directory free from helm templating contents.

The thing is, am I allowed to choose whatever means possible to achieve this or should I wait for some discussions to reach a conclusion and then go on with this PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

@sinloss IMO we should fix bugs in make manifest to generate correct files in deploy (for kubectl) and charts (for helm). Pls check if #212 can achieve it.

terminationGracePeriodSeconds: 10
containers:
- name: manager
Expand Down
2 changes: 1 addition & 1 deletion deploy/role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ metadata:
name: rocketmq-operator
subjects:
- kind: ServiceAccount
name: rocketmq-operator
name: {{ template "rocketmq-operator.serviceAccountName" . }}
namespace: default
roleRef:
kind: ClusterRole
Expand Down
2 changes: 1 addition & 1 deletion deploy/service_account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: rocketmq-operator
name: {{ template "rocketmq-operator.serviceAccountName" . }}