-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix: Support Kubernetes v1.24. Fixes #8320 #9620
Changes from 11 commits
8a69080
689778c
b83128f
58fa693
96f8c90
dacb92b
e20dfd7
dc5d7ad
8c9295a
a8eadd1
244d983
7878acc
88690c4
12d51a1
838f19e
e78ad75
b7147cc
19bf9b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,7 @@ jobs: | |
name: E2E Tests | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 25 | ||
needs: [ tests, argoexec-image ] | ||
needs: [ argoexec-image ] | ||
env: | ||
KUBECONFIG: /home/runner/.kubeconfig | ||
strategy: | ||
|
@@ -86,6 +86,15 @@ jobs: | |
profile: minimal | ||
- test: test-python-sdk | ||
profile: minimal | ||
- test: test-executor | ||
install_k3s_version: v1.21.2+k3s1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm this is not right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the version were running There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should be testing 1.24 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It defaults to latest (v1.25 ATM). These are for testing backwards compatibility. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. Can we rename these tests to differentiate them from the existing ones? It might be better to explicitly set the version so that we know what change breaks the tests? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes/no. I wast trying to avoid forcing all the required checks to be changed. That impacts all PRs, which would need to be synced with master. Using latest reduces maintenance, we don’t need to update it. |
||
profile: minimal | ||
- test: test-corefunctional | ||
install_k3s_version: v1.21.2+k3s1 | ||
profile: minimal | ||
- test: test-functional | ||
install_k3s_version: v1.21.2+k3s1 | ||
profile: minimal | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
|
@@ -105,7 +114,7 @@ jobs: | |
cache: pip | ||
- name: Install and start K3S | ||
run: | | ||
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.21.2+k3s1 INSTALL_K3S_CHANNEL=stable INSTALL_K3S_EXEC=--docker K3S_KUBECONFIG_MODE=644 sh - | ||
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=${{matrix.install_k3s_version}} INSTALL_K3S_CHANNEL=stable INSTALL_K3S_EXEC=--docker K3S_KUBECONFIG_MODE=644 sh - | ||
until kubectl --kubeconfig=/etc/rancher/k3s/k3s.yaml cluster-info ; do sleep 10s ; done | ||
cp /etc/rancher/k3s/k3s.yaml /home/runner/.kubeconfig | ||
echo "- name: fake_token_user" >> $KUBECONFIG | ||
|
@@ -137,19 +146,48 @@ jobs: | |
name: Start controller/API | ||
- run: make wait | ||
timeout-minutes: 4 | ||
name: Wait for MinIO/MySQL etc to be ready | ||
name: Wait for controller to be up | ||
- name: Run tests ${{matrix.test}} | ||
# https://github.com/marketplace/actions/retry-step | ||
uses: nick-fields/[email protected] | ||
with: | ||
timeout_minutes: 20 | ||
max_attempts: 2 | ||
command: make ${{matrix.test}} E2E_SUITE_TIMEOUT=20m STATIC_FILES=false | ||
- if: ${{ failure() }} | ||
name: MinIO/MySQL deployment | ||
run: | | ||
set -eux | ||
kubectl get deploy | ||
kubectl describe deploy | ||
- if: ${{ failure() }} | ||
name: MinIO/MySQL pods | ||
run: | | ||
set -eux | ||
kubectl get pods -l '!workflows.argoproj.io/workflow' | ||
kubectl describe pods -l '!workflows.argoproj.io/workflow' | ||
- if: ${{ failure() }} | ||
name: MinIO/MySQL logs | ||
run: kubectl logs -l '!workflows.argoproj.io/workflow' --prefix | ||
- if: ${{ failure() }} | ||
name: Controller/API logs | ||
run: | | ||
[ -e /tmp/argo.log ] && cat /tmp/argo.log | ||
|
||
- if: ${{ failure() }} | ||
name: Workflows | ||
run: | | ||
set -eux | ||
kubectl get wf | ||
kubectl describe wf | ||
- if: ${{ failure() }} | ||
name: Workflow pods | ||
run: | | ||
set -eux | ||
kubectl get pods -l workflows.argoproj.io/workflow | ||
kubectl describe pods -l workflows.argoproj.io/workflow | ||
- if: ${{ failure() }} | ||
name: Wait container logs | ||
run: kubectl logs -c wait -l workflows.argoproj.io/workflow --prefix | ||
codegen: | ||
name: Codegen | ||
runs-on: ubuntu-latest | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -183,6 +183,7 @@ v1.0 | |
v1.1 | ||
v1.2 | ||
v1.3 | ||
v1.24 | ||
v2 | ||
v2.10 | ||
v2.11 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Kubernetes Secrets | ||
|
||
As of Kubernetes v1.24, secrets are no longer automatically created for service accounts. | ||
|
||
You must create a secret | ||
manually: [Find out how to create these yourself manually](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#manually-create-a-service-account-api-token) | ||
. | ||
|
||
You must make the secret discoverable. You have two options: | ||
|
||
## Option 1 - Discovery By Name | ||
|
||
Name your secret `${serviceAccountName}.service-account-token`. | ||
|
||
```yaml | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: default.service-account-token | ||
annotations: | ||
kubernetes.io/service-account.name: default | ||
type: kubernetes.io/service-account-token | ||
``` | ||
This option is simpler than option 2, as you can combine creating the secret with making it discoverable by name. | ||
## Option 2 - Discovery By Annotation | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are we going to support both options? I didn't code for it. Will k8s automatically support this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is only if there are long service account names, or secret already exists. |
||
Annotate the service account with the secret name: | ||
```yaml | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: default | ||
annotations: | ||
workflows.argoproj.io/service-account-token.name: my-token | ||
``` | ||
This option is useful when the secret already exists, or the service account has a very long name. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
#!/bin/sh | ||
set -eu | ||
set -eu -o pipefail | ||
|
||
port=$1 | ||
|
||
lsof -s TCP:LISTEN -i ":$port" | grep -v PID | awk '{print $2}' | xargs -L 1 kill || true | ||
pids=$(lsof -t -s TCP:LISTEN -i ":$port" || true) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this wrote a lot of errors on linux |
||
|
||
if [ "$pids" != "" ]; then | ||
kill $pids | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: default.service-account-token | ||
annotations: | ||
kubernetes.io/service-account.name: default | ||
type: kubernetes.io/service-account-token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
argoexec-image
is 3m faster thantests
, so this speeds up the build by 3m