Cannot convert docker-compose for long syntax into kubernetes file.
When I use this below docker-compose file for converting into kubernetes file.
version: "3"
services:
redis-master: image: k8s.gcr.io/redis:e2e ports: - target: 6379 published: 6379
redis-slave: image: gcr.io/google_samples/gb-redisslave:v1 ports: - target: 6379 published: 6379 environment: - GET_HOSTS_FROM=dns
frontend: image: gcr.io/google-samples/gb-frontend:v4 ports: - target: 80 published: 80 environment: - GET_HOSTS_FROM=dns labels: kompose.service.type: LoadBalancer
This is the error that it produces.
FATA services.frontend.ports.0 must be a string or number
Does it only support short syntax for conversion ?
@ChitraRJ Please note that long port syntax was added only in docker-compose v3.2 So you need to specify version to 3.2 or larger. Then all will works correctly
https://docs.docker.com/compose/compose-file/compose-file-v3/
Example:
version: "3.2"
services:
redis-master:
image: k8s.gcr.io/redis:e2e
ports:
- target: 6379
published: 6379
redis-slave:
image: gcr.io/google_samples/gb-redisslave:v1
ports:
- target: 6379
published: 6379
environment:
- GET_HOSTS_FROM=dns
frontend:
image: gcr.io/google-samples/gb-frontend:v4
ports:
- target: 80
published: 80
environment:
- GET_HOSTS_FROM=dns
labels:
kompose.service.type: LoadBalancer
@cdrage I guess we can close it then
i experienced this issue and by changing compose file to version "3.2", issue resolved.
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Reopen this issue or PR with
/reopen - Mark this issue or PR as fresh with
/remove-lifecycle rotten - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close
@k8s-triage-robot: Closing this issue.
In response to this:
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied- After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied- After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closedYou can:
- Reopen this issue or PR with
/reopen- Mark this issue or PR as fresh with
/remove-lifecycle rotten- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.