Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add label support to named volumes in docker compose v3 to Kubernetes #1083

Merged
merged 5 commits into from
Nov 29, 2018

Conversation

huikaihoo
Copy link
Contributor

  1. Add the below labels support to named volumes:
  • kompose.volume.selector - Add selector.matchLabels to kubernetes PVC for volume binding
  • kompose.volume.size - Change kubernetes supported volume size for docker named volumes
volumes:
  database-vol:
    labels:
      kompose.volume.selector: database-vol-dev
      kompose.volume.size: 500Mi

For example, the above named volume (database-vol) defined in docker compose file will convert to following Kubernetes config

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  creationTimestamp: null
  labels:
    io.kompose.service: database-vol
  name: database-vol
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 200Mi
  selector:
    matchLabels:
      io.kompose.service: database-vol-dev
status: {}
  1. Fix the PVC size in log message when deploy Kubernetes

  2. Skip creation of PVC if it is already created in the same kubernetes deploy

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 20, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: hangyan

If they are not already assigned, you can assign the PR to them by writing /assign @hangyan in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@concaf concaf removed their request for review November 20, 2018 13:42
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Nov 20, 2018
@cdrage
Copy link
Member

cdrage commented Nov 23, 2018

@huikaihoo

Is there any way for you to add tests? If you run into any difficulty I don't mind helping out 👍

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 28, 2018
@huikaihoo
Copy link
Contributor Author

I added a test case for the new labels

@cdrage
Copy link
Member

cdrage commented Nov 29, 2018

Tests pass: https://semaphoreci.com/cdrage/kompose-2

This LGTM!

@cdrage cdrage merged commit d48ae64 into kubernetes:master Nov 29, 2018
@huikaihoo huikaihoo deleted the pvc-enh branch January 2, 2019 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants