CloudBees action: Deploy to a Kubernetes cluster using a Kustomize configuration

1 minute read

Use this action to customize Kubernetes configurations and resources with the tool Kustomize, which uses overlays to change base YAML manifests without directly modifying them.

Prerequisites

Make sure to initialize the connection using your AWS credentials, by adding the following to your YAML file:

- name: Configure AWS credentials uses: cloudbees-io/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.AUTOMATED_TEST_KUBECTL_ACCESS_KEY }} aws-secret-access-key: ${{ secrets.AUTOMATED_TEST_KUBECTL_SECRET_KEY }} aws-region: ap-south-1

Refer to CloudBees action: Configure AWS credentials for more information.

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

Inputs

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

kustomization-base-dir

String

Yes

Path to the Kustomize base directory.

kustomization-overlays-dir

String

No

Path to the Kustomize overlay directory.

environment-variables

JSON

No

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

Usage example

In your YAML file, add:

- id: k8s-kustomize-deploy name: k8s-kustomize-deploy. uses: cloudbees-io/kustomize-deploy@v1 with: kustomization-base-dir: ${{ cloudbees.workspace }}/base kustomization-overlays-dir: ${{ cloudbees.workspace }}/overlays/dev environment-variables: '{"IMAGE_NAME":"nginx:latest","PORT":80}'