- 
                Notifications
    You must be signed in to change notification settings 
- Fork 453
Resolve “Error loading Login” and ShiftedDate frontend error in Headlamp Helm chart (#4033) #4093
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Manas Ranjan Dikshit <[email protected]>
| [APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Manas-Dikshit 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  | 
| 
 
 | 
| Welcome @Manas-Dikshit!  | 
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.
Hi, it would be great if you could sign the CLA as it's required for contributing to the repo
| signed | 
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.
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.
| 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" | 
    
      
    
      Copilot
AI
    
    
    
      Oct 28, 2025 
    
  
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 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.
| - name: HEADLAMP_IN_CLUSTER | ||
| value: "true" | 
    
      
    
      Copilot
AI
    
    
    
      Oct 28, 2025 
    
  
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 HEADLAMP_IN_CLUSTER environment variable is set twice in the file (lines 71-72 and 291-292). Remove this duplicate entry to avoid confusion.
| - name: HEADLAMP_IN_CLUSTER | |
| value: "true" | 
| persistentVolume: | ||
| enabled: false | ||
| mountPath: "/home/headlamp/.config/Headlamp" | ||
| size: 1Gi | 
    
      
    
      Copilot
AI
    
    
    
      Oct 28, 2025 
    
  
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 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.
| persistentVolume: | |
| enabled: false | |
| mountPath: "/home/headlamp/.config/Headlamp" | |
| size: 1Gi | |
| # Please use the persistentVolumeClaim section above for persistent storage configuration. | 
| resources: | ||
| requests: | ||
| cpu: 100m | ||
| memory: 256Mi | ||
| limits: | ||
| cpu: 500m | ||
| memory: 512Mi | 
    
      
    
      Copilot
AI
    
    
    
      Oct 28, 2025 
    
  
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 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.
| nodeSelector: {} | ||
| tolerations: [] | ||
| affinity: {} | ||
|  | 
    
      
    
      Copilot
AI
    
    
    
      Oct 28, 2025 
    
  
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 keys (nodeSelector, tolerations, affinity) are duplicated from lines 247-249. Remove these duplicate entries to maintain a clean configuration file.
| nodeSelector: {} | |
| tolerations: [] | |
| affinity: {} | 
| affinity: {} | ||
|  | ||
| # ✅ Enable ServiceAccount token mount for OIDC login to work | ||
| automountServiceAccountToken: true | 
    
      
    
      Copilot
AI
    
    
    
      Oct 28, 2025 
    
  
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 automountServiceAccountToken key is duplicated - it already exists at line 75 with the same value. Remove this duplicate entry.
| automountServiceAccountToken: true | 
| 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 | 
Signed-off-by: Manas Ranjan Dikshit <[email protected]>
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:
extraEnv:
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.