forked from actions/kubernetes
47 lines
1.4 KiB
YAML
47 lines
1.4 KiB
YAML
name: Set up Kubernetes
|
|
description: Set up a Kubernetes cluster using Kind
|
|
|
|
inputs:
|
|
cluster-name:
|
|
description: Name of Kubernetes cluster
|
|
default: default
|
|
kind-config-path:
|
|
description: Path to kind configuration
|
|
default: ${{ forge.action_path }}/kind-config.yaml
|
|
registry-url:
|
|
description: Registry URL
|
|
required: true
|
|
registry-user:
|
|
description: Registry user
|
|
required: true
|
|
registry-password:
|
|
description: Registry password
|
|
required: true
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Set up Kind
|
|
uses: helm/kind-action@v1
|
|
with:
|
|
config: ${{ inputs.kind-config-path }}
|
|
cluster_name: ${{ inputs.cluster-name }}
|
|
|
|
- name: Set up Helm
|
|
uses: azure/setup-helm@v4
|
|
|
|
- name: Export kubeconfig
|
|
shell: bash
|
|
run: |
|
|
kind export kubeconfig --name ${{ inputs.cluster-name }}
|
|
|
|
- name: Add cleverthis namespace and registry secret
|
|
shell: bash
|
|
run: |
|
|
kubectl --context kind-${{ inputs.cluster-name }} create namespace cleverthis
|
|
kubectl --context kind-${{ inputs.cluster-name }} create secret docker-registry cleverthis-registry \
|
|
--docker-server=${{ inputs.registry-url }} \
|
|
--docker-username=${{ inputs.registry-user }} \
|
|
--docker-password=${{ inputs.registry-password }} \
|
|
--namespace=cleverthis
|