kompose icon indicating copy to clipboard operation
kompose copied to clipboard

Add support to new depends_on scheme and yaml anchors

Open ngnix opened this issue 2 years ago • 2 comments

Hello kompose team!

I use kompose as part of skaffold local builds.

We have some docker-compose files with new ( compose v3 file references ) syntax, for example:

---
version: '3'

x-container: &container
  restart: always
  logging:
    options:
      max-size: '200k'
      max-file: '10'

services:
  example_service:
    <<: *container
    image: example_service_image
    env_file:
      - app.env
    expose:
      - 3000
    depends_on:
       openssl-init:
        condition: service_completed_successfully
    healthcheck:
      test: >-
        wget -q --no-check-certificate -O /dev/null http://127.0.0.1:$${PORT:-3000}/health-check
    volumes:
      - init_certs:/certs

  openssl-init:
    <<: *container
    image: example_init_image
    restart: 'no'
    environment:
      HOST: $VIRTUAL_HOST
    volumes:
      - init_certs:/tmp

volumes:
  init_certs:

You can see two new sections:

  • YAML anchors into docker-compose
  • new depends_on conditionals, service_completed_successfully wait for init container have status exit 0

Now if I try to convert this docker-compose.yml file into k8s manifest i have error:

  • case one : depends_on, see docs
$ kompose -f docker-compose.yml convert 
FATA services.nuxt.depends_on must be a list  

I think in this case container openssl-init must converted to k8s init container , because this container generate certificates for container example_service.

  • case two : YAML anchors, see docs
$ kompose -f docker-compose.yml convert 
FATA (root) Additional property x-container is not allowed

Can you add support this features to kompose?

Thanks!

ngnix avatar Apr 28 '22 15:04 ngnix

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 27 '22 16: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 26 '22 16:08 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues 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 with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-triage-robot avatar Sep 25 '22 16:09 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues 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 with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

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 25 '22 16:09 k8s-ci-robot