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

feat: Allow the Helm release namespace to be overridden #1797

Closed
wants to merge 1 commit into from

Conversation

sathieu
Copy link
Contributor

@sathieu sathieu commented Oct 4, 2023

for multi-namespace deployments in combined charts

@sathieu sathieu force-pushed the namespaceOverride branch from 5f14e77 to 79831fc Compare October 4, 2023 15:39
@dnskr
Copy link
Contributor

dnskr commented Oct 4, 2023

What is the use case for the changes?

What do you think about avoiding introducing minio-operator.namespace template and using the following code instead?

  namespace: {{ .Values.namespaceOverride | default .Release.Namespace }}

@sathieu sathieu force-pushed the namespaceOverride branch from 79831fc to 51a6b3f Compare October 5, 2023 07:45
@sathieu
Copy link
Contributor Author

sathieu commented Oct 5, 2023

Thanks @dnskr for this review.

What is the use case for the changes?

I use chart dependencies to deploy the operator and multiple tenants.

# Chart.yaml
apiVersion: v2
name: "minio-operator"
version: 0.0.1
dependencies:
  - name: operator
    repository: https://operator.min.io/
    version: 5.0.9
  - alias: tenant1 
    name: tenant
    repository: https://operator.min.io/
    version: 5.0.9
  - alias: tenant2
    name: tenant
    repository: https://operator.min.io/
    version: 5.0.9
# values.yaml
tenant1:
  namespaceOverride: minio-tenant1
tenant2:
  namespaceOverride: minio-tenant2

What do you think about avoiding introducing minio-operator.namespace template and using the following code instead?

  namespace: {{ .Values.namespaceOverride | default .Release.Namespace }}

Done.

@jiuker
Copy link
Contributor

jiuker commented Oct 7, 2023

It looks like you're just using it for testing, and while that's harmless, I don't think it's necessary or best practice for helm. @pjuarezd @shtripat @harshavardhana ^^

@sathieu
Copy link
Contributor Author

sathieu commented Oct 9, 2023

@jiuker We use this for production, not test. We are currently using MinIO Helm chart (i.e. not the operator), with it's limitations (including very limited pool configuration). We want to move to the operator which seems to be the recommended method.

We only have one MinIO cluster (per Kubernetes cluster), i.e. one tenant in the MinIO operator's terminology. This is good practice to use a separate namespace for the operator and each of it's tenants.

The namespaceOverride pattern is very common, as it the Helm dependencies pattern (for example here).

We are using ArgoCD to deploy the Helm charts, and for us MinIO operator and it's tenant is only one ArgoCD application. We can move to one application for the operator and one application for each tenant, if this MR is not accepted.

@jiuker
Copy link
Contributor

jiuker commented Oct 9, 2023

Yeah. Great idea. @harshavardhana @shtripat @pjuarezd cc

@sathieu And could you define as a template like promethrous do that.

@shtripat
Copy link
Contributor

shtripat commented Oct 9, 2023

y one ArgoCD application.

Yeah. Great idea. @harshavardhana @shtripat @pjuarezd cc

@sathieu And could you define as a template like promethrous do that.

@jiuker In my opinion operator is meant to manage multiple tenants. So one operator managing multiple tenants in one k8s cluster is fine. Any specific reason we want to have different operator deployments in different namespaces in same k8s cluster and they in turn maintaining their own tenants?

@jiuker
Copy link
Contributor

jiuker commented Oct 9, 2023

y one ArgoCD application.

Yeah. Great idea. @harshavardhana @shtripat @pjuarezd cc
@sathieu And could you define as a template like promethrous do that.

@jiuker In my opinion operator is meant to manage multiple tenants. So one operator managing multiple tenants in one k8s cluster is fine. Any specific reason we want to have different operator deployments in different namespaces in same k8s cluster and they in turn maintaining their own tenants?

Check the diff files. This pr only want to change the tenant. Not the operator. @shtripat

@shtripat
Copy link
Contributor

shtripat commented Oct 9, 2023

y one ArgoCD application.

Yeah. Great idea. @harshavardhana @shtripat @pjuarezd cc
@sathieu And could you define as a template like promethrous do that.

@jiuker In my opinion operator is meant to manage multiple tenants. So one operator managing multiple tenants in one k8s cluster is fine. Any specific reason we want to have different operator deployments in different namespaces in same k8s cluster and they in turn maintaining their own tenants?

Check the diff files. This pr only want to change the tenant. Not the operator. @shtripat

Oh ok. Then it should be fine.

@dnskr
Copy link
Contributor

dnskr commented Oct 9, 2023

We are using ArgoCD to deploy the Helm charts, and for us MinIO operator and it's tenant is only one ArgoCD application. We can move to one application for the operator and one application for each tenant, if this MR is not accepted.

@sathieu I’m sure it’s better solution, especially because you already use ArgoCD. Also consider App Of Apps Pattern, which provides better management capabilities compare to chart of charts approach.

@sathieu
Copy link
Contributor Author

sathieu commented Oct 9, 2023

We are using ArgoCD to deploy the Helm charts, and for us MinIO operator and it's tenant is only one ArgoCD application. We can move to one application for the operator and one application for each tenant, if this MR is not accepted.

@sathieu I’m sure it’s better solution, especially because you already use ArgoCD. Also consider App Of Apps Pattern, which provides better management capabilities compare to chart of charts approach.

We'll go this path. But it can still contribute to this PR if there is value for you.

@jiuker

@sathieu And could you define as a template like promethrous do that.

The template was in the initial commit. See 5f14e77. I can rollback to this if you agree.

@jiuker
Copy link
Contributor

jiuker commented Oct 9, 2023

We are using ArgoCD to deploy the Helm charts, and for us MinIO operator and it's tenant is only one ArgoCD application. We can move to one application for the operator and one application for each tenant, if this MR is not accepted.

@sathieu I’m sure it’s better solution, especially because you already use ArgoCD. Also consider App Of Apps Pattern, which provides better management capabilities compare to chart of charts approach.

We'll go this path. But it can still contribute to this PR if there is value for you.

@jiuker

@sathieu And could you define as a template like promethrous do that.

The template was in the initial commit. See 5f14e77. I can rollback to this if you agree.

Yeah. It looks better.

@sathieu
Copy link
Contributor Author

sathieu commented Oct 11, 2023

@jiuker rolled back to 5f14e77 and rebased.

@dnskr We moved to another ArgoCD app. So we don't need this PR anymore.

jiuker
jiuker previously approved these changes Oct 12, 2023
helm/tenant/templates/NOTES.txt Outdated Show resolved Hide resolved
jiuker
jiuker previously approved these changes Oct 12, 2023
for multi-namespace deployments in combined charts

Signed-off-by: Mathieu Parent <[email protected]>
Copy link
Contributor

@shtripat shtripat left a comment

Choose a reason for hiding this comment

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

lgtm

@dnskr
Copy link
Contributor

dnskr commented Oct 15, 2023

@dnskr We moved to another ArgoCD app. So we don't need this PR anymore.

Great! I'm using ArgoCD and App of Apps approach as well. It allows to deploy and upgrade applications in a specific order, which is not possible for chart with subcharts.


I found that specifying namespace in Helm charts is quite complex question without super clear answer from my point of view.
There is an issue in the helm repository with a long discussion:

As I understand from the first and the closing answers, namespace should not be explicitly specified in Helm chart templates. All special cases like custom GitOps flows and Spinnaker behavior can be easily mitigated if they still exist.

@jiuker
Copy link
Contributor

jiuker commented Oct 16, 2023

@harshavardhana Any advices for this?

@sathieu
Copy link
Contributor Author

sathieu commented Dec 19, 2023

abandoning this change. We now install two argocd apps.

@sathieu sathieu closed this Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants