CloudBees action: Create or update a Kubernetes resource file

1 minute read

Use this action to create or update a Kubernetes resource file, which groups multiple resources for your application into a single YAML file.

All CloudBees action repositories are listed at CloudBees, Inc. on GitHub.

Inputs

Table 1. Input details
Input name Data type Required? Description

file-path

String

Yes

The path of the Kubernetes resource file to be created/updated.

environment-variables

JSON

No

Kubernetes environment variables, formatted as JSON data in key/value pairs.

environment-variables-path

String

Required only if environment-variables is not specified.

The path of the file that contains the environment variables.

namespace

String

No

The namespace where the created/updated Kubernetes resource file is located.

Usage example

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