porter icon indicating copy to clipboard operation
porter copied to clipboard

Documentation - Kubernetes mixin & internal paths

Open spirilis opened this issue 4 years ago • 1 comments

Greetings!

Upon testing porter for the first time after Carolyn's kubecon talk, I stumbled a bit trying to understand the Kubernetes mixin. I pinged Carolyn on slack and got an answer but I believe it should be documented properly-

In porter's porter/docs/content/mixins/kubernetes.md the example kubernetes mixin makes reference to "/cnab/app/manifests/hello"

The origin of this "/cnab/app" folder was a mystery at first, and now I understand everything inside your Bundle main folder gets copied into /cnab/app for the installer docker.

This fact should be mentioned ideally before any references to the "/cnab/app" paths - perhaps a separate .md page explaining the directory structure of the (default) installer docker would suffice and reference that from various documents where these paths are used by prospective bundle developers.

spirilis avatar Oct 15 '21 22:10 spirilis

Agreed! Thanks for opening the issue so that we can track this.

The path /cnab/app is required by the CNAB spec and when we had created porter, we wanted to not require people to know anything about that stuff. This unfortunately "leaked" and on top of documenting what is the location of your bundle's files in the docker image, it would be great to fix how we do parameters so that you don't need to know about this path.

I think that we could do a few things to clear things up and also make it so that people don't have to know about it either.

  • Document which files are automatically copied into the bundle, where they go, and how to customize that with a custom dockerfile. Encourage people to work with relative paths.

  • I think that the kubernetes mixin actually works with relative paths. Let's make sure that's documented well and there aren't any spots where an absolute path is required.

  • Declared state variables in v1 all let you specify a relative path, e.g.

    state:
      - name: tfstate
        path: terraform/terraform.tfstate
    

    Let's make sure that an author can do the same for credentials, parameters and outputs. So that if they stick to relative paths, they don't need to remember /cnab/app.

carolynvs avatar Oct 18 '21 13:10 carolynvs