Porter Manifest File Format 1.1.0
Porter Manifest File Format 1.1.0
Bundle manifest file format version 1.1.0 is compatible with an unreleased version of Porter that supports the advanced dependencies feature (PEP003). This is a placeholder page to document the changes to the manifest, but this version of the schema is unreleased.
Changes
Support Dependencies v2 in the dependencies
section.
- Add dependencies.requires.DEP.bundle.interface which defines the child bundle interface.
- Add dependencies.requires.DEP.bundle.credentials which specifies how to satisfy credentials on the child bundle.
- Add dependencies.requires.DEP.sharing which specifies how a dependency can be shared with other bundles.
- Add dependencies.provides which specifies how the bundle can satisfy a dependency, such as declaring that it provides a named bundle interface.
Example
schemaType: Bundle
schemaVersion: 1.1.0
name: myapp
version: 1.0.0
description: Install my great application
registry: localhost:5000
reference: localhost:5000/myapp:v1.0.0
dockerfile: template.Dockerfile
maintainers:
- name: Qi Lu
- email: sal@example.com
- name: Frank
url: https://example.com/frank
custom:
app:
version: 1.2.3
commit: abc123
required:
- docker:
privileged: true
mixins:
- exec
- helm3:
clientVersion: 3.1.2
credentials:
- name: kubeconfig
description: A kubeconfig with cluster admin role
path: /root/.kube/config
- name: token
env: GITHUB_TOKEN
applyTo:
- release
parameters:
- name: log-level
description: Log level for MyApp
type: integer
env: MYAPP_LOG_LEVEL
applyTo:
- install
- upgrade
- name: connstr
description: MyApp database connection string
type: string
env: MYAPP_CONNECTION_STRING
sensitive: true
source:
dependency: mysql
output: admin-connstr
applyTo:
- upgrade
- status
- name: release-name
type: string
env: RELEASE
default: myapp
state:
- name: tfstate
description: Store terraform state with the bundle instead of a remote backend
path: terraform/terraform.tfstate
dependencies:
provides:
interface:
id: "https://example.com/interfaces/#something"
requires:
- name: mysql
bundle:
reference: getporter/mysql:v0.1.1
interface:
id: "https://getporter.org/interfaces/#mysql"
sharing:
mode: group
group:
name: myapp
parameters:
database: myapp
logLevel: ${bundle.parameters.log-level}
credentials:
kubeconfig: ${bundle.credentials.kubeconfig}
outputs:
admin-connstr: Server=${outputs.server};Database={outputs.database};Uid=admin;Pwd=${outputs.password};
outputs:
- name: app-token
description: Access token for MyApp
type: file
path: /cnab/app/myapp_token
sensitive: true
applyTo:
- install
- name: ip-address
type: string
images:
myapp:
repository: example/myapp
digest: sha256:568461508c8d220742add8abd226b33534d4269868df4b3178fae1cba3818a6e
install:
- helm3:
description: "Install MyApp"
name: ${ bundle.parameters.release }
chart: ./charts/myapp
replace: true
set:
image.repository: ${ bundle.images.myapp.repository }
image.digest: ${ bundle.images.myapp.digest }
upgrade:
- helm3:
name: ${ bundle.parameters.release }
chart: ./charts/myapp
set:
image.repository: ${ bundle.images.myapp.repository }
image.digest: ${ bundle.images.myapp.digest }
uninstall:
- helm3:
purge: true
releases:
- ${ bundle.parameters.release }
poke:
- exec:
command: ./poke-myapp.sh
customActions:
status:
description: See what's up in there
modifies: false
stateless: true
status:
- exec:
command: ./status.sh
Fields
Field | Required | Description |
---|---|---|
schemaType | false | The type of document. |
schemaVersion | true | The version of the Bundle schema used in this file. |
name | true | The name of the bundle. |
version | true | The version of the bundle, must adhere to semver v2. The bundle tag defaults to the version with a v prefix, e.g. mybundle:v1.0.0. Use –tag or the reference field to override. |
description | false | A description of the bundle. |
registry | true* | The OCI registry to use when the bundle is published. *Either registry or reference must be specified. |
reference | true* | The full reference to use when the bundle is published to an OCI registry. *Either registry or reference must be specified. |
dockerfile | false | The relative path to a Dockerfile to use as a template during porter build. |
maintainers | false | A list of maintainers for the bundle. |
maintainers.name | false | Name of the maintainer. |
maintainers.email | false | Email of the maintainer. |
maintainers.url | false | Url of the maintainer. |
custom | false | An object of custom bundle metadata. |
required | false | A list of additional features required by the bundle. |
required.docker | false | Indicate that the bundle requires a Docker host/daemon. |
required.docker.privileged | false | Run the bundle in a privileged container. |
mixins | true | A list of mixins used in the bundle. May include additional configuration settings depending on the mixin. |
credentials | false | A list of credentials used by the bundle. |
credentials.name | true | The name of the credential. |
credentials.description | false | A description of the credential, how its used, and how to find it. |
credentials.required | false | Indicates if the credential is required. |
credentials.applyTo | false | A list of actions that apply to this item. When none are specified, all actions apply. |
credentials.env | true | The environment variable name, such as MY_VALUE, into which the credential value is stored. Either env or path must be specified. |
credentials.path | true | The path inside the bundle where the credential value is stored. Either env or path must be specified. |
parameters | false | A list of parameters used by the bundle. |
parameters.name | true | The name of the parameter. |
parameters.description | false | A description of the parameter and how it is used. |
parameters.default | false | The default value of the parameter. When no default is set, the parameter is required. |
parameters.applyTo | false | A list of actions that apply to this item. When none are specified, all actions apply. |
parameters.env | true | The environment variable name, such as MY_VALUE, into which the parameter value is stored. Either env or path must be specified. |
parameters.path | true | The path inside the bundle where the parameter value is stored. Either env or path must be specified. |
parameters.type | true | The parameter type. Allowed values are: string, number, integer, boolean, object, or file. |
parameters.sensitive | false | Indicates whether this parameter’s value is sensitive and should not be logged. |
parameters.source | false | Indicates that the parameter should get its value from an external source. |
parameters.source.output | true | An output name. The parameter’s value is set to output’s last value. |
parameters.source.dependency | false | The name of the dependency that generated the output. If not set, the output must be generated by the current bundle. |
state | false | State variables that are generated by the bundle and injected on subsequent runs. |
state.name | true | The name of this state variable |
state.description | false | Description of how the variable is used by the bundle. |
state.mixin | false | The name of the mixin that generates and manages this state variable. |
state.path | true | The path inside of the bundle where the state variable data is stored. |
outputs | false | A list of output values produced by the bundle. |
outputs.name | true | The name of the output. |
outputs.description | false | A description of the output and what it represents. |
outputs.default | false | The default value of the output. When no default is set, the output is required. |
outputs.applyTo | false | A list of actions that apply to this item. When none are specified, all actions apply. |
outputs.path | true | The path inside the bundle where the output value is stored. |
outputs.type | true | The output type. Allowed values are: string, number, integer, boolean, object, or file. |
outputs.sensitive | false | Indicates whether this output’s value is sensitive and should not be logged. |
images | false | A map of images referenced in the bundle. When the bundle is relocated, the referenced images are copied to the new bundle location. |
images.KEY.description | false | A description of the image and how it is used. |
images.KEY.repository | true | The repository portion of the image reference, i.e. docker.io/library/nginx |
images.KEY.digest | true | The repository digest of the image, e.g. sha256:cafebabe… |
dependencies | false | Other bundles that this bundle relies upon. |
dependencies.provides | false | Specifies how the current bundle can be used to satisfy a dependency. |
dependenices.provides.interface.id | false | URI of the interface that this bundle provides. Usually a well-known name defined by Porter or CNAB. |
dependencies.requires | true | A list of bundles that should be executed with this bundle. |
dependencies.requires.name | true | A name for the dependency, used to refer to the dependency using the template syntax bundle.dependencies.NAME . |
dependencies.requires.bundle.interface | false | Criteria for allowing a bundle to satisfy a dependency. |
dependencies.requires.bundle.interface.reference | false | An OCI reference to a bundle to use as the interface on top of how the bundle is used. |
dependencies.requires.bundle.interface.document | false | Document specifies additional constraints that should be added to the bundle interface. By default, Porter only requires the name and the type to match, additional jsonschema values can be specified to restrict matching bundles even further. The value should be a jsonschema document containing relevant sub-documents from a bundle.json that should be applied to the base bundle interface. |
dependencies.requires.bundle.reference | true | A full bundle reference that can be used as the default implementation of the bundle in the format REGISTRY/NAME:TAG. |
dependencies.requires.bundle.version | false | Semver v3 constraint used to select a more recent release of the bundle. May use wildcard syntax such as 1.0.x or 2.* . Use vX.Y.Z-0 to allow prerelease versions to be resolved by Porter. |
dependencies.requires.credentials | false | A map of credential names to their value or source. May use templating such as ${ bundle.credentials.NAME} . |
dependencies.requires.parameters | false | A map of parameters names to their value or source. May use templating such as ${ bundle.parameters.NAME} . |
dependencies.requires.sharing | false | A set of rules for sharing a dependency with other bundles. |
dependencies.requires.sharing.mode | false | The sharing mode defines how a dependency can be shared: none, group. Defaults to group. |
dependencies.requires.sharing.group | false | A sharing group defines matching criteria for determining if two dependencies are in the same sharing group. |
dependencies.requires.sharing.group.name | false | Name of the sharing group. The name of the group must match for two bundles to share the same dependency. |
customActions | false | A map of action names to a custom action definition. |
customActions.NAME.description | false | A description of the action. |
customActions.NAME.modifies | false | Specifies if the action will modify resources managed by a bundle in any way. |
customActions.NAME.stateless | false | Specifies that the action could be run before the bundle is installed and does not require credentials. |