Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hackathon): poc for using infra resources through teleport #2822

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/shared-infra-resources-poc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: shared-infra-resources-poc

on:
push:
branches:
- shared-infra-resources-poc

permissions:
contents: read
id-token: write

env:
NAMESPACE_PREFIX: distribution-
CLUSTER_NAME: camunda-ci-eks-dev # infra testing on dev cluster -> change to camunda-ci-eks for prod
TOKEN: infra-ci-dev-github-action-distribution
LABELS: janitor/ttl=1h camunda.cloud/ephemeral=true

jobs:
teleport-setup:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Teleport
uses: teleport-actions/setup@v1
with:
version: 17.2.2

- name: Authenticate with Teleport
uses: teleport-actions/auth-k8s@v2
with:
proxy: camunda.teleport.sh:443
token: ${{ env.TOKEN }}
kubernetes-cluster: ${{ env.CLUSTER_NAME }}

- name: Create namespace
id: create-namespace
run: |
RANDOM_ID=$(openssl rand -hex 3)
NAMESPACE="${{ env.NAMESPACE_PREFIX }}${RANDOM_ID}"
kubectl create namespace $NAMESPACE
kubectl get namespaces
kubectl label namespace $NAMESPACE ${{ env.LABELS }} --overwrite=true
echo "::set-output name=namespace::$NAMESPACE"

- name: Delete namespace
if: always()
run: |
kubectl delete namespace ${{ steps.create-namespace.outputs.namespace }} || true
Loading