kompose icon indicating copy to clipboard operation
kompose copied to clipboard

Cannot convert docker-compose for long syntax into kubernetes file.

Open ChitraRJ opened this issue 3 years ago • 4 comments

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 avatar Feb 16 '22 07:02 ChitraRJ

@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

sergeyshevch avatar Mar 21 '22 12:03 sergeyshevch

i experienced this issue and by changing compose file to version "3.2", issue resolved.

sivanbecker avatar Apr 13 '22 06:04 sivanbecker

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

k8s-triage-robot avatar Jul 12 '22 06:07 k8s-triage-robot

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

k8s-triage-robot avatar Aug 11 '22 07:08 k8s-triage-robot

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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 avatar Sep 10 '22 07:09 k8s-triage-robot

@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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

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.

k8s-ci-robot avatar Sep 10 '22 07:09 k8s-ci-robot