Use this action to create or update a Kubernetes resource file, which groups multiple resources for your application into a single YAML file.
Input name | Data type | Required? | Description |
---|---|---|---|
|
String |
Yes |
The path of the Kubernetes resource file to be created/updated. |
|
JSON string |
Required only if |
Kubernetes environment variables, formatted as JSON data in key/value pairs. |
|
String |
Required only if |
The path of the file containing the environment variables. |
|
String |
No |
The namespace where the created/updated Kubernetes resource file is located. |
In your YAML file, add:
- name: Create or update a Kubernetes resource
uses: cloudbees-io/kubernetes-create-resource@v1
with:
file-path: ${{ cloudbees.workspace }}/input.yml
environment-variables: '{"IMAGE_NAME":"nginx:latest","CUSTOM_VALUE":"alpine:latest","port":"80"}'
environment-variables-path: ${{ cloudbees.workspace }}/sample.json
namespace: my-namespace
This code is made available under the MIT license.
-
Learn more about using actions in CloudBees workflows.
-
Learn about the CloudBees platform.