Create vcluster #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create vcluster | |
on: | |
workflow_dispatch: | |
inputs: | |
vcluster-name: | |
description: 'Name of vcluster to create' | |
default: "my-vcluster" | |
env: | |
VCLUSTER_NAME: ${{ inputs.vcluster-name || 'my-vcluster' }} | |
# define a job that creates a vcluster using the Loft CLI. | |
jobs: | |
create-cluster: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: Install Loft CLI | |
uses: loft-sh/setup-loft@v2 | |
with: | |
version: v3.2.4 | |
url: ${{ secrets.LOFT_URL }} | |
# Specify your Loft access key here | |
access-key: ${{ secrets.LOFT_DEV_CLUSTER_ACCESS_KEY }} | |
- name: Create Cluster | |
run: | | |
# Make sure to recreate if there is an already existing environment | |
loft create vcluster $VCLUSTER_NAME --project preview --recreate | |
ls -la | |
kubectl config view > kubeconfig.yaml | |
loft use vcluster $VCLUSTER_NAME --project preview --print | |
ls -la | |
kubectl get pods -A | |
curl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64 | |
sudo install -m 555 argocd-linux-amd64 /usr/local/bin/argocd | |
rm argocd-linux-amd64 | |
argocd login argocd.k8s.kurtmadel.com --grpc-web --username admin --password ${{ secrets.ARGOCD_ADMIN_PASSWORD }} | |
argocd cluster add $(kubectl config current-context) | |