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

Update kubectl auth in CI #94

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .github/actions/gke-kubeconfig/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ runs:
using: "composite"
steps:
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v1
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ inputs.gkeCredentials }}
create_credentials_file: true
- name: Get cluster credentials using GitHub action
uses: google-github-actions/get-gke-credentials@v1
uses: google-github-actions/get-gke-credentials@v2
with:
project_id: ${{ env.GOOGLE_CLOUD_PROJECT }}
location: ${{ inputs.location }}
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/expire.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,14 @@ on:

jobs:
expire_clusters:
strategy:
matrix:
distribution: [GKE]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./provision-cluster
with:
action: expire
distribution: ${{ matrix.distribution }}
kubeceptionToken: ${{ secrets.KUBECEPTION_TOKEN }}
distribution: GKE
gkeCredentials: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
slackWebhook: ${{ secrets.SLACK_WEBHOOK_URL }}
slackChannel: "#team-infra"
slackRunbook: "Runbook TBD"

60 changes: 31 additions & 29 deletions .github/workflows/matrix.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Telepresence Test Matrix"
name: "Test Matrix"
on:
push:
branches:
Expand All @@ -20,53 +20,32 @@ on:
default: 'warning'

jobs:
telepresence_matrix:
test_matrix_gke:
strategy:
matrix:

client_os: [ubuntu]
client_arch: [latest]

client_telepresence_version: ["2.7"]

clusters:
- distribution: GKE
version: "1.27"

- distribution: Kubeception
version: "1.27"

- distribution: GKE
version: "1.27"
- version: "1.27"
- version: "1.27"
config: '{ "initialNodeCount" : 2 }'

cluster_telepresence_version: ["none"]

runs-on: ${{ matrix.client_os }}-${{ matrix.client_arch }}
env:
KUBECEPTION_TOKEN: ${{ secrets.KUBECEPTION_TOKEN }}
GKE_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
steps:
- uses: actions/checkout@v4
- name: Kubectl tool installer
uses: Azure/setup-kubectl@v3
with:
# These tests require Kubectl 1.25 or lower since 1.26+ does noe support the GCP auth plugin
version: 'v1.25.3'
- uses: Azure/setup-kubectl@v3
- uses: ./provision-cluster
with:
distribution: ${{ matrix.clusters.distribution }}
distribution: GKE
version: ${{ matrix.clusters.version }}
kubeconfig: kubeconfig.yaml
kubeceptionToken: ${{ matrix.clusters.distribution == 'Kubeception' && env.KUBECEPTION_TOKEN }}
gkeCredentials: ${{ matrix.clusters.distribution == 'GKE' && env.GKE_CREDENTIALS }}
gkeCredentials: ${{ env.GKE_CREDENTIALS }}
gkeConfig: ${{ matrix.clusters.config }}

useAuthProvider: "false"
- run: |
echo Testing telepresence client version ${{ matrix.client_telepresence_version }} on ${{ matrix.client_os }} ${{ matrix.client_arch }} against server version ${{ matrix.cluster_telepresence_version }} on ${{ matrix.clusters.distribution }} cluster version ${{ matrix.clusters.version }}
kubectl version
kubectl get pods -A

- name: "validate gke config"
if: ${{ startsWith(matrix.clusters.config, '{') }}
run: |
Expand All @@ -77,3 +56,26 @@ jobs:
echo "Gke config was not used"
exit 1
fi

test_matrix_kubeception:
strategy:
matrix:
client_os: [ubuntu]
client_arch: [latest]
clusters:
- version: "1.27"
runs-on: ${{ matrix.client_os }}-${{ matrix.client_arch }}
env:
KUBECEPTION_TOKEN: ${{ secrets.KUBECEPTION_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: Azure/setup-kubectl@v3
- uses: ./provision-cluster
with:
distribution: Kubeception
version: ${{ matrix.clusters.version }}
kubeconfig: kubeconfig.yaml
kubeceptionToken: ${{ env.KUBECEPTION_TOKEN }}
- run: |
kubectl version
kubectl get pods -A
49 changes: 31 additions & 18 deletions .github/workflows/smoke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,55 @@ on:
- '.github/workflows/smoke.yaml'

jobs:
release_smoke:
release_smoke_gke:
strategy:
fail-fast: false
matrix:
clusters:
- distribution: GKE
version: "1.27"
useAuthProvider: "true"

- distribution: GKE
version: "1.27"
useAuthProvider: "false"

- distribution: Kubeception
version: "1.27"
- version: "1.27"
runs-on: ubuntu-latest
env:
KUBECEPTION_TOKEN: ${{ secrets.KUBECEPTION_TOKEN }}
GKE_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
steps:
- name: Kubectl tool installer
uses: Azure/setup-kubectl@v3
- id: provision
uses: datawire/infra-actions/[email protected]
with:
version: 'v1.25.3'
distribution: GKE
version: ${{ matrix.clusters.version }}
kubeconfig: ${{ runner.temp}}/kubeconfig.yaml
gkeCredentials: ${{ env.GKE_CREDENTIALS }}
useAuthProvider: "false"
- name: "Get kubeconfig and cluster information"
run: |
set -e
kubectl config view
kubectl version
kubectl get pods -A

release_smoke_kubeception:
strategy:
fail-fast: false
matrix:
clusters:
- version: "1.27"
runs-on: ubuntu-latest
env:
KUBECEPTION_TOKEN: ${{ secrets.KUBECEPTION_TOKEN }}
steps:
- name: Kubectl tool installer
uses: Azure/setup-kubectl@v3
- id: provision
uses: datawire/infra-actions/[email protected]
with:
distribution: ${{ matrix.clusters.distribution }}
distribution: Kubeception
version: ${{ matrix.clusters.version }}
kubeconfig: ${{ runner.temp}}/kubeconfig.yaml
kubeceptionToken: ${{ matrix.clusters.distribution == 'Kubeception' && env.KUBECEPTION_TOKEN }}
gkeCredentials: ${{ matrix.clusters.distribution == 'GKE' && env.GKE_CREDENTIALS }}
useAuthProvider: ${{ matrix.clusters.useAuthProvider }}
kubeceptionToken: ${{ env.KUBECEPTION_TOKEN }}
- name: "Get kubeconfig and cluster information"
run: |
set -e
kubectl config view
kubectl version --short
kubectl version
kubectl get pods -A
39 changes: 24 additions & 15 deletions docs/GITHUB_ACTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,43 @@ By including this github action in your workflow you can easily run the same tes

```yaml
jobs:
my_matrix_job:
my_matrix_job_gke:
strategy:
matrix:
clusters:
- distribution: GKE
version: "1.27"
useAuthProvider: "false"
- distribution: GKE
version: "1.27"
useAuthProvider: "true"
- distribution: AKS
version: "1.27"
- distribution: Kubeception
version: "1.27"
- version: "1.26"
- version: "1.27"
- version: "1.28"
steps:
# The provision-cluster action will automatically register a cleanup hook to remove the
# cluster it provisions when the job is done.
- uses: datawire/infra-actions/[email protected]
with:
distribution: ${{ matrix.clusters.distribution }}
distribution: GKE
version: ${{ matrix.clusters.version }}
# Tells provision-cluster where to write the kubeconfig file.
kubeconfig: kubeconfig.yaml

kubeceptionToken: ${{ secrets.KUBECEPTION_TOKEN }}
gkeCredentials: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
useAuthProvider: "false"
- run: make tests

useAuthProvider: ${{ matrix.clusters.useAuthProvider }}
my_matrix_job_kubeception:
strategy:
matrix:
clusters:
- version: "1.26"
- version: "1.27"
- version: "1.28"
steps:
# The provision-cluster action will automatically register a cleanup hook to remove the
# cluster it provisions when the job is done.
- uses: datawire/infra-actions/[email protected]
with:
distribution: Kubeception
version: ${{ matrix.clusters.version }}
# Tells provision-cluster where to write the kubeconfig file.
kubeconfig: kubeconfig.yaml
kubeceptionToken: ${{ secrets.KUBECEPTION_TOKEN }}
- run: make tests
```

Expand Down
Loading