Skip to content

Commit

Permalink
Create teleport token for chart install during testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-french committed Dec 31, 2023
1 parent 57ccbd9 commit 2700113
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,32 @@ jobs:
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
11 changes: 10 additions & 1 deletion charts/moonswitch-agent/ci/test-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
teleport-kube-agent:
enabled: true
kubeClusterName: ci-test
highAvailability: {}
highAvailability:
replicaCount: 1
requireAntiAffinity: false
podDisruptionBudget:
enabled: false
# The join token secret is created by Github Actions
# before the chart is installed
joinTokenSecret:
create: false
name: "teleport-kube-agent-join-token"

0 comments on commit 2700113

Please sign in to comment.