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

[k8s] Fix generate_kubeconfig.sh when ingress is not used #3864

Merged
merged 2 commits into from
Sep 6, 2024

Conversation

romilbhardwaj
Copy link
Collaborator

generate_kubeconfig.sh would fail when a cluster doesn't have ingress:

Error from server (NotFound): error when creating "STDIN": namespaces "ingress-nginx" not found
Error from server (NotFound): error when creating "STDIN": namespaces "ingress-nginx" not found

This PR makes it optional, and any errors due to ingress not being present are ignored.

@@ -169,6 +169,9 @@ roleRef:
kind: Role
name: skypilot-system-service-account-role
apiGroup: rbac.authorization.k8s.io
EOF
# Apply optional ingress-related roles, but don't make the script fail if it fails
kubectl apply -f - <<EOF || true
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we echo some message when it fails?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks, added!

@@ -169,6 +169,9 @@ roleRef:
kind: Role
name: skypilot-system-service-account-role
apiGroup: rbac.authorization.k8s.io
EOF
# Apply optional ingress-related roles, but don't make the script fail if it fails
kubectl apply -f - <<EOF || true
---
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need this --- here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good catch, removed now.

@romilbhardwaj romilbhardwaj added this pull request to the merge queue Sep 6, 2024
Merged via the queue into master with commit 3159281 Sep 6, 2024
20 checks passed
@romilbhardwaj romilbhardwaj deleted the fix_generate_kubeconfig branch September 6, 2024 23:13
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