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

[stable/kube-downscaler] Kube-Downscaler does not respect release namespace when templating #601

Conversation

hlascelles
Copy link
Contributor

@hlascelles hlascelles commented Sep 10, 2024

The kube-downscaler helm chart doesn't honour the namespace passed in to helm. This is because the chart is missing the typical metadata configuration on its kubernetes resources. ie, this problem is the same as this one for another chart: #216

To reproduce this problem:

helm fetch deliveryhero/kube-downscaler --version 0.7.4 --untar=true
helm template my-release kube-downscaler --namespace kube-system  > kube-downscaler.yaml

The deployment.yaml and other files will have no namespace. ie, it is not configured here:

Fix is as below for the required resources:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: "{{ $fullname }}-{{ .name }}"
  namespace: {{ .Release.Namespace }}

Checklist

  • Title of the PR starts with chart name (e.g. [stable/mychartname])
  • I have read the contribution instructions, bumped chart version and regenerated the docs
  • Github actions are passing

The `kube-downscaler` helm chart doesn't honor the namespace passed in to helm. This is because the chart is missing the typical metadata configuration on its kubernetes resources. ie, this problem is the same as this one for another chart: deliveryhero#216

To reproduce this problem:

```bash
helm fetch deliveryhero/kube-downscaler --version 0.7.4 --untar=true
helm template my-release kube-downscaler --namespace kube-systen  > kube-downscaler.yaml
```

The `deployment.yaml` and other files will have no namespace. ie, it is not configured here: https://github.com/deliveryhero/helm-charts/blob/0b420820e3f88d5e7f9f10ddd1c9a029adb9a422/stable/kube-downscaler/templates/deployment.yaml#L3

Fix is as below:

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: "{{ $fullname }}-{{ .name }}"
  namespace: {{ .Release.Namespace }}
```
@hlascelles hlascelles requested a review from a team as a code owner September 10, 2024 07:32
@hlascelles hlascelles changed the title Kube-Downscaler does not respect release namespace when templating [stable/kube-downscaler] Kube-Downscaler does not respect release namespace when templating Sep 16, 2024
@max-rocket-internet
Copy link
Member

@hlascelles there was a checklist of items that are required to make a PR mergeable that you deleted when you opened the PR 😃

https://github.com/deliveryhero/helm-charts/blob/master/.github/pull_request_template.md#checklist

@hlascelles
Copy link
Contributor Author

Nice! Hmm, that doc regenerate wiped out a lot. Is that right?

@max-rocket-internet
Copy link
Member

Nice! Hmm, that doc regenerate wiped out a lot. Is that right?

Not right, you need to run it from repo root

@hlascelles hlascelles requested a review from a team as a code owner September 17, 2024 09:50
Copy link
Member

@max-rocket-internet max-rocket-internet left a comment

Choose a reason for hiding this comment

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

Nice, thanks @hlascelles 💜

@max-rocket-internet max-rocket-internet enabled auto-merge (squash) September 17, 2024 09:53
@max-rocket-internet max-rocket-internet merged commit ad2432b into deliveryhero:master Sep 17, 2024
5 checks passed
fekaiser pushed a commit to gastromatic/delivery-hero-helm-charts that referenced this pull request Oct 23, 2024
…espace when templating (deliveryhero#601)

* Kube-Downscaler does not respect release namespace when templating

The `kube-downscaler` helm chart doesn't honor the namespace passed in to helm. This is because the chart is missing the typical metadata configuration on its kubernetes resources. ie, this problem is the same as this one for another chart: deliveryhero#216

To reproduce this problem:

```bash
helm fetch deliveryhero/kube-downscaler --version 0.7.4 --untar=true
helm template my-release kube-downscaler --namespace kube-systen  > kube-downscaler.yaml
```

The `deployment.yaml` and other files will have no namespace. ie, it is not configured here: https://github.com/deliveryhero/helm-charts/blob/0b420820e3f88d5e7f9f10ddd1c9a029adb9a422/stable/kube-downscaler/templates/deployment.yaml#L3

Fix is as below:

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: "{{ $fullname }}-{{ .name }}"
  namespace: {{ .Release.Namespace }}
```

* Bump version for change

* Regenerate docs

* Regenerate docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants