Adding a Kubernetes or OpenShift component to a devfile
You can add either a kubernetes
or openshift
component to a devfile.
-
Define a component using the
kubernetes
oropenshift
property. -
Provide the content through the
uri
orinlined
property.Example 1. Adding anopenshift
component using theuri
propertycomponents: - name: mysql openshift: uri: petclinic.yaml
Example 2. Adding akubernetes
component using theinlined
propertycomponents: - 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 an image component defined in the devfile, you can create a compositedeploy
command to build the image and deploy the Kubernetes or openshift component. For more information ondeploy
commands, see Adding a command group to a devfile