Adding a kubernetes
or openshift
component to a devfile
This section describes how to add either a kubernetes
or openshfit
component to a devfile. You can apply configurations to your devfile with kubernetes
or openshift
components.
Prerequisites
Procedure
-
Define a component using the type
kubernetes
oropenshift
. -
Provide the content through the
uri
orinlined
property.Example 1. Addingopenshift
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. -
Associate
kubernetes
oropenshift
components withApply
commands. If you do not associateApply
commands, they are assumed to be applied at start up.