Skip to content

Conversation

@Manas-Dikshit
Copy link

Fixes #4033
— “Digital Ocean - Error loading Login”
Summary
This PR addresses both the backend login issue and frontend rendering error reported in issue #4033 when deploying Headlamp via Helm on DigitalOcean Kubernetes (and similar managed clusters).

Root Cause
The backend was not correctly configured to use the in-cluster Kubernetes config, leading to:
error loading kubeconfig files: error reading kubeconfig file: open : no such file or directory

The frontend was using an older image version that triggered:
TypeError: Class constructor ShiftedDate cannot be invoked without 'new'

Fix Implemented
Enabled in-cluster mode explicitly:

config:
inCluster: true

Added explicit backend arguments and environment variables:

extraArgs:

  • "--in-cluster"
    extraEnv:
  • name: HEADLAMP_IN_CLUSTER
    value: "true"

Pinned Headlamp image version to 0.37.0, which resolves the ShiftedDate frontend error.
Ensured service account and cluster role binding are properly created for OIDC login.

Files Updated
charts/headlamp/values.yaml
Testing
Deployed updated chart via Helm:
helm upgrade --install headlamp ./charts/headlamp -f values.yaml

Verified:
Backend successfully loads in-cluster configuration.
OIDC login flow completes without “Error loading login”.
Frontend loads correctly without ShiftedDate error.

Tested on:
DigitalOcean Kubernetes
Minikube (local)

Result
Headlamp now authenticates properly via OIDC, runs cleanly in-cluster, and the frontend loads without JS exceptions.

Signed-off-by: Manas Ranjan Dikshit <[email protected]>
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Manas-Dikshit
Once this PR has been reviewed and has the lgtm label, please assign sniok for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

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

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 27, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: Manas-Dikshit / name: Manas Ranjan Dikshit (83904a1)

@k8s-ci-robot
Copy link
Contributor

Welcome @Manas-Dikshit!

It looks like this is your first PR to kubernetes-sigs/headlamp 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/headlamp has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot requested a review from yolossn October 27, 2025 18:02
@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Oct 27, 2025
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 27, 2025
Copy link
Contributor

@skoeva skoeva left a comment

Choose a reason for hiding this comment

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

Hi, it would be great if you could sign the CLA as it's required for contributing to the repo

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Oct 27, 2025
@Manas-Dikshit
Copy link
Author

signed
@skoeva

@illume illume requested a review from Copilot October 28, 2025 13:28
@illume illume marked this pull request as draft October 28, 2025 13:28
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 28, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes backend authentication and frontend rendering issues in the Headlamp Helm chart when deploying to managed Kubernetes clusters like DigitalOcean. The root causes were improper in-cluster configuration and an outdated frontend image causing a JavaScript error.

Key changes:

  • Enabled in-cluster mode explicitly with backend arguments and environment variables
  • Pinned Headlamp image to version 0.37.0 to resolve the ShiftedDate frontend error
  • Added explicit service account naming and ensured proper RBAC bindings

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +280 to +288
extraArgs:
- "--in-cluster" # Ensures backend loads cluster config correctly
- "--plugins-dir=/headlamp/plugins"
- "--static-plugins-dir=/headlamp/static-plugins"

# ✅ Enable logging for debugging OIDC issues
extraEnv:
- name: HEADLAMP_LOG_LEVEL
value: "debug"
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

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

The extraArgs and extraEnv keys are duplicated - they already exist at lines 67 and 70-72. This creates conflicting configuration definitions in the same values file. Either remove the duplicates or consolidate them into single definitions with all required values.

Copilot uses AI. Check for mistakes.
Comment on lines +291 to +292
- name: HEADLAMP_IN_CLUSTER
value: "true"
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

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

The HEADLAMP_IN_CLUSTER environment variable is set twice in the file (lines 71-72 and 291-292). Remove this duplicate entry to avoid confusion.

Suggested change
- name: HEADLAMP_IN_CLUSTER
value: "true"

Copilot uses AI. Check for mistakes.
Comment on lines +303 to +306
persistentVolume:
enabled: false
mountPath: "/home/headlamp/.config/Headlamp"
size: 1Gi
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

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

This persistentVolume configuration appears to be a new top-level key that differs from the existing persistentVolumeClaim at line 143. This creates inconsistent volume configuration options. Consider using the existing persistentVolumeClaim structure or clearly document why both are needed.

Suggested change
persistentVolume:
enabled: false
mountPath: "/home/headlamp/.config/Headlamp"
size: 1Gi
# Please use the persistentVolumeClaim section above for persistent storage configuration.

Copilot uses AI. Check for mistakes.
Comment on lines +323 to +329
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 500m
memory: 512Mi
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

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

The resources key is duplicated - it already exists at line 187 with an empty value. This second definition overrides the first one. Remove the duplicate at line 187 or consolidate these into a single definition.

Copilot uses AI. Check for mistakes.
Comment on lines +331 to +334
nodeSelector: {}
tolerations: []
affinity: {}

Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

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

These keys (nodeSelector, tolerations, affinity) are duplicated from lines 247-249. Remove these duplicate entries to maintain a clean configuration file.

Suggested change
nodeSelector: {}
tolerations: []
affinity: {}

Copilot uses AI. Check for mistakes.
affinity: {}

# ✅ Enable ServiceAccount token mount for OIDC login to work
automountServiceAccountToken: true
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

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

The automountServiceAccountToken key is duplicated - it already exists at line 75 with the same value. Remove this duplicate entry.

Suggested change
automountServiceAccountToken: true

Copilot uses AI. Check for mistakes.
@ashu8912
Copy link
Member

ashu8912 commented Oct 29, 2025

Hii @Manas-Dikshit most of this code doesn't justify why things are added or removed, can you please provide better commit messages and description for them

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 30, 2025
Signed-off-by: Manas Ranjan Dikshit <[email protected]>
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Digital Ocean - Error loading Login

4 participants