Authoring devfiles - Components
Adding a kubernetes or openshift component
You can add either a kubernetes
or openshift
component to a devfile.
Prerequisites
Procedure
Define a component using the
kubernetes
oropenshift
property.Provide the content through the
uri
orinlined
property.Adding an openshift component using the uri property
devfile.yamlcomponents: - name: mysql openshift: uri: petclinic.yaml
Adding a kubernetes component using the inlined property
devfile.yamlcomponents: - name: myk8deploy kubernetes: inlined: apiVersion: batch/v1 kind: Job metadata: name: pi spec: template: spec: containers: - name: job image: myimage command: ["some", "command"] restartPolicy: Never
Specify the endpoint through the endpoint property with
kubernetes
oropenshift
components.By default
kubernetes
oropenshift
components are not going to be deployed. SpecifydeployByDefault: true
if you want to apply the component at start up.Associate
kubernetes
oropenshift
components withapply
commands wthdeploy
command group kind. If thekubernetes
oropenshift
component uses an image built by animage
component defined in the devfile, you can create a compositedeploy
command to build the image and deploy thekubernetes
oropenshift
component. For more information ondeploy
commands, see adding a command group.