-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add specify namespace installation #2700
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
|
/test fluid-e2e |
Codecov Report
@@ Coverage Diff @@
## master #2700 +/- ##
==========================================
- Coverage 67.55% 67.54% -0.01%
==========================================
Files 381 381
Lines 21968 21982 +14
==========================================
+ Hits 14840 14848 +8
- Misses 5381 5386 +5
- Partials 1747 1748 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
| {{- if .Values.installation.namespace -}} | ||
| {{ .Values.installation.namespace }} | ||
| {{- else -}} | ||
| {{ .Release.Namespace}} |
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.
{{ .Release.Namespace }}
|
good job ! The namespace setting are also set in the code, and need to be modified together e.g.: You can check by keyword "fluid-system" with IDE's global search |
|
The leader-election-namespace parameter currently does not support injection @allenhaozi @cheyang |
ffb8db5 to
fad9b96
Compare
done |
I found another reference that needs to be checked to see if it needs to be modified synchronously |
Is it possible to change it to datasetKey.Namespace? |
This should be the same as the dataset controller's namespace, two ways to get this value are recommended. env:
- name: MY_POD_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespacefilePath :="/var/run/secrets/kubernetes.io/serviceaccount/namespace"
nsRead ,err :=ioutil.ReadFile(filePath)
if err !=nil {
return ctrl.Result{}, err
} |
|
Can it be obtained through common.MyPodNamespace @allenhaozi |
The env is not set in the deployment of dataset controller. We need to add it synchronically |
f6b8ce2 to
56a0edc
Compare
charts/fluid/fluid/values.yaml
Outdated
| image: | ||
| imagePullSecrets: [] | ||
|
|
||
| installation: |
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.
helm charts values are all installation dependent,
so direct use of namespace is recommended
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.
done
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.
/lgtm
|
/test fluid-e2e |
charts/fluid/fluid/values.yaml
Outdated
| image: | ||
| imagePullSecrets: [] | ||
|
|
||
| namespace: |
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.
how about set fluid-system as default value to maintain previous behavior and prevent conflicts when upgrading?
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.
-n fluid-system
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.
I agree with @zwwhdls because we'd better not introduce any installation or upgrade change for the existing users. I think they will use fluid-system namespace if not specifying anything.
2221430 to
3c78efb
Compare
| } | ||
|
|
||
| if match { | ||
| ns, err := utils.GetEnvByKey(common.MyPodNamespace) |
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.
I think the variable names should be descriptive so that anyone reading the code can understand their purpose. For example, the variable names ns is not descriptive enough. How about using namespace instead?
| if match { | ||
| ns, err := utils.GetEnvByKey(common.MyPodNamespace) | ||
| if err != nil { | ||
| return controllerName, scaleout, errors.Wrapf(err, "get namespace from env failed, env key:%s", common.MyPodNamespace) |
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.
And if it's failed to get the namespace from environment variable, how about using default namespace fluid-system instead? In fact, I think the most of users will not change the default namespace.
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.
The default is default, if you want to install to fluid-system, you need to specify -n fluid-system
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.
But the existing default management namespace is fluid-system, I think we should keep this consistency.
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.
Managed by the Release.Namespace mechanism
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.
helm install -n fluid-system will change helm release from default to fluid-system. It doesn't make sense with existing users.
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.
I also prefer using the system namespace with pre-defined name like other projects.
https://github.com/karmada-io/karmada/blob/master/charts/karmada/values.yaml#L23
https://github.com/openkruise/charts/blob/master/versions/kruise/1.3.0/values.yaml#L8
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.
These lose the meaning of -n xxx
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.
The fetch environment variable is set synchronously with the configuration
this shouldn't return error ?
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.
These lose the meaning of -n xxx
I admire your professional,but the paramount concern is to ensure that our existing users are not adversely affected in production.
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.
done
| metadata: | ||
| name: alluxioruntime-controller | ||
| namespace: fluid-system | ||
| namespace: {{ .Release.Namespace }} |
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 is a general approach, such as the following project
https://github.com/kubevela/kubevela/blob/master/charts/vela-core/templates/kubevela-controller.yaml#L200
https://github.com/crossplane/crossplane/blob/master/cluster/charts/crossplane/templates/deployment.yaml#L5
But given the compatibility of previous strategy
# values.yaml
# If the user wants to use -n mode, remove the default value of values
namespace: "fluid-system"# _helpers.tpl
{{- define "fluid.namespace" -}}
{{- if .Values.namespace }}
{{- .Values.namespace }}
{{- else }}
{{- .Release.Namespace -}}
{{- end }}
{{- end }}kind: Deployment
metadata:
name: alluxioruntime-controller
namespace: {{ include "fluid.namespace" . }}If the user wants to use -n mode, remove the default value of values
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 --set to override the default
helm install fluid ./fluid -n test --set namespace=''
643caa1 to
b64d49d
Compare
Signed-off-by: fengshunli <1171313930@qq.com>
|
Kudos, SonarCloud Quality Gate passed!
|
| image: fluidcloudnative/fluid-crd-upgrader:v0.9.0-a21f6b3 | ||
|
|
||
| ## if unspecified, will use built-in variable `.Release.Namespace`. | ||
| namespace: fluid-system |
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 very much!
|
/test fluid-e2e |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: allenhaozi, cheyang 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 |
|
Thanks @fengshunli for your contribution! |








Ⅰ. Describe what this PR does
Ⅱ. Does this pull request fix one issue?
fixes #2679
Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews