carvel-dev / kapp

kapp is a simple deployment tool focused on the concept of "Kubernetes application" — a set of resources with the same label

Home Page:https://carvel.dev/kapp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kapp deploy fails when K8s server host, port and kubeconfig is passed as env and port is empty.

rohitagg2020 opened this issue · comments

What steps did you take:
kapp deploy fails when K8s server host, port and kubeconfig is passed as env and port is empty.

To reproduce the issue

$ export KUBERNETES_SERVICE_HOST=32.123.12.123
$ export KUBERNETES_SERVICE_PORT=
$ export KAPP_KUBECONFIG_YAML=`
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data:...
    server: https://${KAPP_KUBERNETES_SERVICE_HOST_PORT}
    ....
.....
`
$ kapp deploy -a samplepackage-ctrl -f package-resources.yml --kubeconfig=/dev/null

What happened:
kapp deploy errors out with following error:

kapp: Error: yaml: line 5: mapping values are not allowed in this context

What did you expect:
kapp deploy to succeed.

Anything else you would like to add:
Issue is easily reproducible on GKE cluster.

Environment:

  • kapp version (use kapp --version):
  • OS (e.g. from /etc/os-release):
  • Kubernetes version (use kubectl version)

Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

I'm willing to work on this. The issue asks that it succeeds if KUBERNETES_SERVICE_PORT is empty. Should we then default to 6443?

@vicmarbev Thanks for showing your interest. We would be more than glad to have PR from you.

I'm willing to work on this. The issue asks that it succeeds if KUBERNETES_SERVICE_PORT is empty. Should we then default to 6443?

Yes, it should succeed if KUBERNETES_SERVICE_PORT is empty. We can default it to 443.