Skip to content

Add moonswitch-agent chart #13

Add moonswitch-agent chart

Add moonswitch-agent chart #13

Workflow file for this run

name: Lint and Test Charts
on: pull_request
jobs:
lint-test:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.13.0
# Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and
# yamllint (https://github.com/adrienverge/yamllint) which require Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config ct.yaml)
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Run chart-testing (lint)
run: ct lint --config ct.yaml
- name: Create kind cluster
uses: helm/kind-action@v1.8.0
if: steps.list-changed.outputs.changed == 'true'
- name: Fetch Teleport binaries
uses: teleport-actions/setup@v1
with:
version: 14.2.3
- name: Fetch credentials using Machine ID
id: auth
uses: teleport-actions/auth@v2
with:
proxy: teleport.prd.moonswitch.io:443
token: moonswitch-automation
- name: Create teleport join token for cluster
run: |
token=$(tctl tokens add --type=kube --format=json | jq -r '.token')
echo "TELEPORT_TOKEN=$token" >> $GITHUB_ENV
- name: Bootstrap Cluster
id: bootstrap-cluster
run: |
# Create moonswitch namespace and teleport secret
echo "Creating 'moonswitch' namespace..."
kubectl create ns moonswitch --dry-run=client -o yaml | kubectl apply -f -
echo "Creating teleport join token secret...."
kubectl --namespace moonswitch create secret generic teleport-kube-agent-join-token --from-literal=auth-token=${TELEPORT_TOKEN} --dry-run=client -o yaml | kubectl apply -f -
- name: Run chart-testing (install)
run: ct install --config ct.yaml