Closed greyarch closed 4 years ago
A simple solution is to start a proxy to the API that listens on 8080.
kubectl proxy --port=8080
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle rotten
Yeah, this is critical and needs to be fixed. Thank you @greyarch
A lot of clusters use 6443 by default now... you're totally correct.
/remove-lifecycle rotten
Hello!
@cdrage I am not sure if this is the right place to ask this. I am incredibly new to both Kubernetes
and Kompose
I have a docker-compose.yml
file that does work locally without issue and I was under the impression I would be able to use kompose up
on it to spin up my deployment on my minikube
locally.
However when I run it I get this output
╭─lknecht@愛と支えボックス ~/Repositories/api_webserver/api_webserver ‹feature/create_minikube_deployment-dev*›
╰─$ kompose up --file continuous_integration/local_api_docker_compose.yml 1 ↵
INFO Build key detected. Attempting to build and push image 'lab/api'
INFO Building image 'lab/api' from directory 'api_webserver'
INFO Image 'lab/api' from directory 'api_webserver' built successfully
INFO Pushing image 'lab/api:latest' to registry 'docker.io'
INFO Attempting authentication credentials 'https://index.docker.io/v1/
INFO Successfully pushed image 'lab/api:latest' to registry 'docker.io'
INFO Build key detected. Attempting to build and push image 'lab/api'
INFO Building image 'lab/api' from directory 'api_webserver'
INFO Image 'lab/api' from directory 'api_webserver' built successfully
INFO Pushing image 'lab/api:latest' to registry 'docker.io'
INFO Attempting authentication credentials 'https://index.docker.io/v1/
INFO Successfully pushed image 'lab/api:latest' to registry 'docker.io'
INFO We are going to create Kubernetes Deployments, Services and PersistentVolumeClaims for your Dockerized application. If you need different kind of resources, use the 'kompose convert' and 'kubectl create -f' commands instead.
FATA Error while deploying application: Get http://localhost:8080/api: dial tcp [::1]:8080: connect: connection refused
This is my docker-compose.yml
file's contents
version: "3.7"
services:
api:
build:
context: ../.
dockerfile: ./continuous_integration/api_webserver.dockerfile
image: lab/api
command: ["sh", "-c", "python manage.py makemigrations api &&
python manage.py migrate &&
gunicorn --bind 0.0.0.0:$$CI_API_PORT api_webserver.wsgi"]
depends_on:
- rabbitmq
- redis
- postgres
env_file:
- ./local_api_docker_compose.env
networks:
- backend
ports:
- "8000:8000"
volumes:
- "api_media:/opt/api_webserver/media"
worker:
build:
context: ../.
dockerfile: ./continuous_integration/api_webserver.dockerfile
image: lab/api
command: ["sh", "-c", "celery worker --app=api_webserver --loglevel=INFO"]
depends_on:
- api
- rabbitmq
- redis
- postgres
env_file:
- ./local_api_docker_compose.env
networks:
- backend
volumes:
- "api_media:/opt/api_webserver/media"
postgres:
image: postgres:12-alpine
env_file:
- ./local_api_docker_compose.env
networks:
- backend
ports:
- "5432:5432"
rabbitmq:
image: "rabbitmq:3.7-alpine"
hostname: "rabbitmq"
depends_on:
- redis
env_file:
- ./local_api_docker_compose.env
networks:
- backend
ports:
- "5672:5672" # Broker port
- "15672:15672" # Management port
redis:
image: "redis:5.0-alpine"
hostname: "redis"
networks:
- backend
ports:
- "6379:6379"
networks:
backend:
volumes:
api_media:
I have tried the work around of running kubectl proxy --port=8080
in a separate terminal window for proxying, but then the output changes to this
╭─lknecht@愛と支えボックス ~/Repositories/api_webserver/api_webserver ‹feature/create_minikube_deployment-dev*›
╰─$ kompose --file continuous_integration/local_api_docker_compose.yml up
INFO Build key detected. Attempting to build and push image 'lab/api'
INFO Building image 'lab/api' from directory 'api_webserver'
INFO Image 'lab/api' from directory 'api_webserver' built successfully
INFO Pushing image 'lab/api:latest' to registry 'docker.io'
INFO Attempting authentication credentials 'https://index.docker.io/v1/
INFO Successfully pushed image 'lab/api:latest' to registry 'docker.io'
INFO Build key detected. Attempting to build and push image 'lab/api'
INFO Building image 'lab/api' from directory 'api_webserver'
INFO Image 'lab/api' from directory 'api_webserver' built successfully
INFO Pushing image 'lab/api:latest' to registry 'docker.io'
INFO Attempting authentication credentials 'https://index.docker.io/v1/
INFO Successfully pushed image 'lab/api:latest' to registry 'docker.io'
INFO We are going to create Kubernetes Deployments, Services and PersistentVolumeClaims for your Dockerized application. If you need different kind of resources, use the 'kompose convert' and 'kubectl create -f' commands instead.
INFO Deploying application in "default" namespace
INFO Successfully created Service: api
INFO Successfully created Service: postgres
INFO Successfully created Service: rabbitmq
INFO Successfully created Service: redis
FATA Error while deploying application: the server could not find the requested resource
Apologies if I'm creating a bunch of unrelated noise, I'm just not sure if I'm doing something wrong, or the tool is working incorrectly.
Any guidance is appreciated.
The 8080 port issue seems comes from a dependency of kompose, and it's hard to change that.
Hello!
@cdrage I am not sure if this is the right place to ask this. I am incredibly new to both
Kubernetes
andKompose
I have a
docker-compose.yml
file that does work locally without issue and I was under the impression I would be able to usekompose up
on it to spin up my deployment on myminikube
locally.However when I run it I get this output
╭─lknecht@愛と支えボックス ~/Repositories/api_webserver/api_webserver ‹feature/create_minikube_deployment-dev*› ╰─$ kompose up --file continuous_integration/local_api_docker_compose.yml 1 ↵ INFO Build key detected. Attempting to build and push image 'lab/api' INFO Building image 'lab/api' from directory 'api_webserver' INFO Image 'lab/api' from directory 'api_webserver' built successfully INFO Pushing image 'lab/api:latest' to registry 'docker.io' INFO Attempting authentication credentials 'https://index.docker.io/v1/ INFO Successfully pushed image 'lab/api:latest' to registry 'docker.io' INFO Build key detected. Attempting to build and push image 'lab/api' INFO Building image 'lab/api' from directory 'api_webserver' INFO Image 'lab/api' from directory 'api_webserver' built successfully INFO Pushing image 'lab/api:latest' to registry 'docker.io' INFO Attempting authentication credentials 'https://index.docker.io/v1/ INFO Successfully pushed image 'lab/api:latest' to registry 'docker.io' INFO We are going to create Kubernetes Deployments, Services and PersistentVolumeClaims for your Dockerized application. If you need different kind of resources, use the 'kompose convert' and 'kubectl create -f' commands instead. FATA Error while deploying application: Get http://localhost:8080/api: dial tcp [::1]:8080: connect: connection refused
This is my
docker-compose.yml
file's contentsversion: "3.7" services: api: build: context: ../. dockerfile: ./continuous_integration/api_webserver.dockerfile image: lab/api command: ["sh", "-c", "python manage.py makemigrations api && python manage.py migrate && gunicorn --bind 0.0.0.0:$$CI_API_PORT api_webserver.wsgi"] depends_on: - rabbitmq - redis - postgres env_file: - ./local_api_docker_compose.env networks: - backend ports: - "8000:8000" volumes: - "api_media:/opt/api_webserver/media" worker: build: context: ../. dockerfile: ./continuous_integration/api_webserver.dockerfile image: lab/api command: ["sh", "-c", "celery worker --app=api_webserver --loglevel=INFO"] depends_on: - api - rabbitmq - redis - postgres env_file: - ./local_api_docker_compose.env networks: - backend volumes: - "api_media:/opt/api_webserver/media" postgres: image: postgres:12-alpine env_file: - ./local_api_docker_compose.env networks: - backend ports: - "5432:5432" rabbitmq: image: "rabbitmq:3.7-alpine" hostname: "rabbitmq" depends_on: - redis env_file: - ./local_api_docker_compose.env networks: - backend ports: - "5672:5672" # Broker port - "15672:15672" # Management port redis: image: "redis:5.0-alpine" hostname: "redis" networks: - backend ports: - "6379:6379" networks: backend: volumes: api_media:
I have tried the work around of running
kubectl proxy --port=8080
in a separate terminal window for proxying, but then the output changes to this╭─lknecht@愛と支えボックス ~/Repositories/api_webserver/api_webserver ‹feature/create_minikube_deployment-dev*› ╰─$ kompose --file continuous_integration/local_api_docker_compose.yml up INFO Build key detected. Attempting to build and push image 'lab/api' INFO Building image 'lab/api' from directory 'api_webserver' INFO Image 'lab/api' from directory 'api_webserver' built successfully INFO Pushing image 'lab/api:latest' to registry 'docker.io' INFO Attempting authentication credentials 'https://index.docker.io/v1/ INFO Successfully pushed image 'lab/api:latest' to registry 'docker.io' INFO Build key detected. Attempting to build and push image 'lab/api' INFO Building image 'lab/api' from directory 'api_webserver' INFO Image 'lab/api' from directory 'api_webserver' built successfully INFO Pushing image 'lab/api:latest' to registry 'docker.io' INFO Attempting authentication credentials 'https://index.docker.io/v1/ INFO Successfully pushed image 'lab/api:latest' to registry 'docker.io' INFO We are going to create Kubernetes Deployments, Services and PersistentVolumeClaims for your Dockerized application. If you need different kind of resources, use the 'kompose convert' and 'kubectl create -f' commands instead. INFO Deploying application in "default" namespace INFO Successfully created Service: api INFO Successfully created Service: postgres INFO Successfully created Service: rabbitmq INFO Successfully created Service: redis FATA Error while deploying application: the server could not find the requested resource
Apologies if I'm creating a bunch of unrelated noise, I'm just not sure if I'm doing something wrong, or the tool is working incorrectly.
Any guidance is appreciated.
Hi Guys,
I have exactly the same problem. Does anyone know how to fix it?
Thanks
This is a big deal. Kompose is essentially just yaml converter now. I'm getting this on all up's/down's actions.
FATA Error while deploying application: Get http://localhost:8080/api: dial tcp [::1]:8080: connect: connection refused
Any status here? We struggle with the same issue
Tempory solution:
export KUBERNETES_MASTER=https://127.0.0.1:6443
kompose....
Finale solution: update code (the library we use is serious out of date, it's a bit of messy)
@CiaraCode I just merge a PR for this issue, if you can try the master build..
@hangyan your solution did not work for us... In OpenStack Rancher, I have tried installing a software named Waldur throgh Komposer. We have successfully:
When this is done with your solution, we get asked for username and password (not happened before) and then it shows connection refused.
Then we tried master build without doing the export KUBERNETES_MASTER=https://127.0.0.1:6443 and we still keep getting the same "...could not find requested resource" error.
We get "...could not find requested resource" error."
what's in your lube config file?
From: CiaraCode notifications@github.com Sent: Wednesday, December 25, 2019 5:17:50 AM To: kubernetes/kompose kompose@noreply.github.com Cc: Hang Yan hang.yan@hotmail.com; Mention mention@noreply.github.com Subject: Re: [kubernetes/kompose] Error when targeting a different (than 8080) API port (#1131)
@hangyanhttps://github.com/hangyan your solution did not work for us... In OpenStack Rancher, I have tried installing a software named Waldur throgh Komposer. We have successfully:
When this is done with your solution, we get asked for username and password (not happened before) and then it shows connection refused.
Then we tried master build without doing the export KUBERNETES_MASTER=https://127.0.0.1:6443 and we still keep getting the same "...could not find requested resource" error.
We get "...could not find requested resource" error."
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/kubernetes/kompose/issues/1131?email_source=notifications&email_token=AA6BVR3QKYBVTWG2IYGMJXLQ2J375A5CNFSM4HOIBLA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHTT6PY#issuecomment-568803135, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA6BVRZFVMEG62LS7C6DILLQ2J375ANCNFSM4HOIBLAQ.
kompse use you kubeconifg to access the cluster. Since it now is the 6443 port, it certainly need some auth. usually it is in the kubeconifg file
From: Hang Yan hang.yan@hotmail.com Sent: Wednesday, December 25, 2019 8:26:19 AM To: kubernetes/kompose reply@reply.github.com; kubernetes/kompose kompose@noreply.github.com Cc: Mention mention@noreply.github.com Subject: Re: [kubernetes/kompose] Error when targeting a different (than 8080) API port (#1131)
what's in your lube config file?
From: CiaraCode notifications@github.com Sent: Wednesday, December 25, 2019 5:17:50 AM To: kubernetes/kompose kompose@noreply.github.com Cc: Hang Yan hang.yan@hotmail.com; Mention mention@noreply.github.com Subject: Re: [kubernetes/kompose] Error when targeting a different (than 8080) API port (#1131)
@hangyanhttps://github.com/hangyan your solution did not work for us... In OpenStack Rancher, I have tried installing a software named Waldur throgh Komposer. We have successfully:
When this is done with your solution, we get asked for username and password (not happened before) and then it shows connection refused.
Then we tried master build without doing the export KUBERNETES_MASTER=https://127.0.0.1:6443 and we still keep getting the same "...could not find requested resource" error.
We get "...could not find requested resource" error."
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/kubernetes/kompose/issues/1131?email_source=notifications&email_token=AA6BVR3QKYBVTWG2IYGMJXLQ2J375A5CNFSM4HOIBLA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHTT6PY#issuecomment-568803135, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA6BVRZFVMEG62LS7C6DILLQ2J375ANCNFSM4HOIBLAQ.
@hangyan
Still getting this same error. I have tried with 1.20 and building from master, 1.20.0 (dd3f6a28)
kompose version
1.20.0 (dd3f6a28)
kompose up
INFO We are going to create Kubernetes Deployments, Services and PersistentVolumeClaims for your Dockerized application. If you need different kind of resources, use the 'kompose convert' and 'kubectl create -f' commands instead.
FATA Error while deploying application: Get https://127.0.0.1:6443/api: dial tcp 127.0.0.1:6443: connect: connection refused
I verified that my .kube/config
is properly configred and am able to run kubectl
deployments from it. I also attempted to use export KUBERNETES_MASTER=https://127.0.0.1:8443
without any success. kompose still points to 6443.
I'm sorry for that. The current solution is not good enough, it use a very old client-go version and my fixed only add support for port 6443. I will figure out some to allow user customized pod
@AcelinkIT Sorry for your inconvenient , would you mind to try the master build again?
export KUBERNETES_MASTER=https://127.0.0.1:6443
works
getting prompted for un/pw... seems a separate problem...
I'm getting this error:
FATA Error while deleting application: Get "https://127.0.0.1:6443/api": x509: certificate signed by unknown authority
When I visit https://127.0.0.1:6443/api, I see this:
{
"kind": "Status",
"apiVersion": "v1",
"metadata": {
},
"status": "Failure",
"message": "forbidden: User \"system:anonymous\" cannot get path \"/api\"",
"reason": "Forbidden",
"details": {
},
"code": 403
}
Any clues how to address this situation?
If anyone lands here, this version of compose worked for me on mac
:
curl -L https://github.com/kubernetes-incubator/kompose/releases/download/v1.18.0/kompose-darwin-amd64 -o kompose
chmod +x kompose
sudo mv ./kompose /usr/local/bin/kompose
I also have similar issue on the latest kompose . My error is:
FATA Error while deploying application: Get "https://127.0.0.1:6443/api": dial tcp 127.0.0.1:6443: connect: connection refused
@hangyan , I am still facing the issue. I even tried running minikube using minikube start --apiserver-port=6443
but still facing the issue. I checked you PR #1204 , is it merged and published yet ?
Same issue here. I just installed kompose fresh and get the following :
kompose up
INFO We are going to create Kubernetes Deployments, Services and PersistentVolumeClaims for your Dockerized application. If you need different kind of resources, use the 'kompose convert' and 'kubectl create -f' commands instead.
FATA Error while deploying application: Get http://localhost:8080/api: dial tcp 127.0.0.1:8080: connect: connection refused
Here is the docker-compose.yml file I am using:
version: '3'
services:
#Nginx Service
webserver:
image: nginx:alpine
container_name: webserver
restart: always
tty: true
ports:
- "80:80"
- "443:443"
networks:
- app-network
#Docker Networks
networks:
app-network:
driver: bridge
#Volumes
volumes:
dbdata:
driver: local
Anyone? Please!!!
I am useing k3s and by default the kubernetes API listens on port
6443
. When trying to dokompose up
in this situation I getError while deploying application: Get http://localhost:8080/api: dial tcp [::1]:8080: connect: connection refused
Is there a way to target a different (than 8080) port?