Skip to content

spectrocloud/k8s-set-context

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

typescript-action status

Spectro Cloud Kubernetes

Spectro Cloud

This action can be used to set the Kuberentes context for Spectro Cloud clusters.

The action will retrieve the latest available Kubeconfig for the target K8s cluster and set the context as appropriate.

Action inputs

Action inputs Description
host
Host
(Optional) Spectro Cloud API endpoint. Default points to the Spectro Cloud SaaS endpoint: api.spectrocloud.com
username
Username
Spectro Cloud Username (e.g: [email protected])
password
Password
Spectro Cloud Password (e.g: superSecure1#)
projectName
Project Name
Name of the project where the K8s cluster is running, e.g: Default
clusterName
Cluster Name
Lookup the cluster via the name, e.g: cluster1
clusterTags
Cluster Tags
Lookup a cluster via tags, e.g: cicd -> hipster (see example)

Example usage

- uses: spectrocloud/k8s-set-context@v1
  with:
    host: {enter Spectro Cloud API Endpoint (optional)}
    username: {enter user's Spectro Cloud Username}
    password: {enter user's Spectro Cloud Password}
    projectName: {enter Spectro Cloud Project Name}
    clusterName: {enter Spectro Cloud K8s cluster name}
    clusterTags: {enter Spectro Cloud K8s tags (see example below)}
  id: setcontext

Please note that all input except host are required. Either one of clusterName or clusterTags is required

The clusterTags can be specified as a yaml string, e.g:

- uses: spectrocloud/k8s-set-context@v1
  with:
    clusterTags: |
      cicd: hipster
      dev: spectro__tag

   ... (other properties)

Support

Refer to the Spectro Cloud Documentation for more information on how to retrieve the required properties.

Please file a GitHub issue for any support or questions regarding the integration.