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 Kubernetes and Tekton #1093

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
341 changes: 171 additions & 170 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,180 +1,181 @@
on:
pull_request:
branches:
- main
- master
push:
paths-ignore:
- 'README.md'
- 'docs/**'
branches:
- main
- master
name: Unit, Integration, and E2E Tests
on:
pull_request:
branches:
- main
push:
paths-ignore:
- 'README.md'
- 'docs/**'
branches:
- main

jobs:
unit:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '1.18.x'
cache: true
check-latest: true
- name: Build
run: make build
- name: Test
run: make test-unit-coverage
integration:
strategy:
fail-fast: false
matrix:
kubernetes:
- v1.21.2
max-parallel: 2
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '1.18.x'
cache: true
check-latest: true
- name: Install Ko
# This sha corresponds to v0.5
uses: imjasonh/setup-ko@78eea08f10db87a7a23a666a4a6fe2734f2eeb8d
with:
version: v0.11.2
- name: Install kubectl
uses: azure/setup-kubectl@v1
with:
version: ${{ matrix.kubernetes }}
- name: Create kind cluster
uses: helm/kind-action@v1.3.0
with:
version: v0.11.1
node_image: kindest/node:${{ matrix.kubernetes }}
cluster_name: kind
wait: 120s
- name: Verify kind cluster
run: |
echo "# Using KinD context..."
kubectl config use-context "kind-kind"
echo "# KinD nodes:"
kubectl get nodes
unit:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '1.18.x'
cache: true
check-latest: true
- name: Build
run: make build
- name: Test
run: make test-unit-coverage

NODE_STATUS=$(kubectl get node kind-control-plane -o json | jq -r .'status.conditions[] | select(.type == "Ready") | .status')
if [ "${NODE_STATUS}" != "True" ]; then
echo "# Node is not ready:"
kubectl describe node kind-control-plane
integration:
strategy:
fail-fast: false
matrix:
kubernetes:
- v1.23.6
max-parallel: 2
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '1.18.x'
cache: true
check-latest: true
- name: Install Ko
# This sha corresponds to v0.5
uses: imjasonh/setup-ko@78eea08f10db87a7a23a666a4a6fe2734f2eeb8d
with:
version: v0.11.2
- name: Install kubectl
uses: azure/setup-kubectl@v1
with:
version: ${{ matrix.kubernetes }}
- name: Create kind cluster
uses: helm/kind-action@v1.3.0
with:
version: v0.14.0
node_image: kindest/node:${{ matrix.kubernetes }}
cluster_name: kind
wait: 120s
- name: Verify kind cluster
run: |
echo "# Using KinD context..."
kubectl config use-context "kind-kind"
echo "# KinD nodes:"
kubectl get nodes

echo "# Pods:"
kubectl get pod -A
echo "# Events:"
kubectl get events -A
NODE_STATUS=$(kubectl get node kind-control-plane -o json | jq -r .'status.conditions[] | select(.type == "Ready") | .status')
if [ "${NODE_STATUS}" != "True" ]; then
echo "# Node is not ready:"
kubectl describe node kind-control-plane

exit 1
fi
- name: Install Tekton
run: |
make kind-tekton
kubectl -n tekton-pipelines rollout status deployment tekton-pipelines-controller --timeout=1m
kubectl -n tekton-pipelines rollout status deployment tekton-pipelines-webhook --timeout=1m
- name: Test
run: |
export GIT_CONTAINER_IMAGE="$(KO_DOCKER_REPO=kind.local ko publish ./cmd/git)"
make test-integration
e2e:
strategy:
fail-fast: false
matrix:
kubernetes:
- v1.21.2
max-parallel: 2
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '1.18.x'
cache: true
check-latest: true
- name: Install kubectl
uses: azure/setup-kubectl@v1
with:
version: ${{ matrix.kubernetes }}
- name: Create kind cluster
uses: helm/kind-action@v1.3.0
with:
version: v0.11.1
node_image: kindest/node:${{ matrix.kubernetes }}
cluster_name: kind
config: test/kind/config.yaml
wait: 120s
- name: Verify kind cluster
run: |
echo "# Using KinD context..."
kubectl config use-context "kind-kind"
echo "# KinD nodes:"
kubectl get nodes
echo "# Pods:"
kubectl get pod -A
echo "# Events:"
kubectl get events -A

NODE_STATUS=$(kubectl get node kind-control-plane -o json | jq -r .'status.conditions[] | select(.type == "Ready") | .status')
if [ "${NODE_STATUS}" != "True" ]; then
echo "# Node is not ready:"
kubectl describe node kind-control-plane
exit 1
fi
- name: Install Tekton
run: |
make kind-tekton
kubectl -n tekton-pipelines rollout status deployment tekton-pipelines-controller --timeout=1m
kubectl -n tekton-pipelines rollout status deployment tekton-pipelines-webhook --timeout=1m
- name: Test
run: |
export GIT_CONTAINER_IMAGE="$(KO_DOCKER_REPO=kind.local ko publish ./cmd/git)"
make test-integration

echo "# Pods:"
kubectl get pod -A
echo "# Events:"
kubectl get events -A
e2e:
strategy:
fail-fast: false
matrix:
kubernetes:
- v1.23.6
max-parallel: 2
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '1.18.x'
cache: true
check-latest: true
- name: Install kubectl
uses: azure/setup-kubectl@v1
with:
version: ${{ matrix.kubernetes }}
- name: Create kind cluster
uses: helm/kind-action@v1.3.0
with:
version: v0.14.0
node_image: kindest/node:${{ matrix.kubernetes }}
cluster_name: kind
config: test/kind/config.yaml
wait: 120s
- name: Verify kind cluster
run: |
echo "# Using KinD context..."
kubectl config use-context "kind-kind"
echo "# KinD nodes:"
kubectl get nodes

NODE_STATUS=$(kubectl get node kind-control-plane -o json | jq -r .'status.conditions[] | select(.type == "Ready") | .status')
if [ "${NODE_STATUS}" != "True" ]; then
echo "# Node is not ready:"
kubectl describe node kind-control-plane

exit 1
fi
- name: Install Tekton
run: |
make kind-tekton
kubectl -n tekton-pipelines rollout status deployment tekton-pipelines-controller --timeout=1m
kubectl -n tekton-pipelines rollout status deployment tekton-pipelines-webhook --timeout=1m
- name: Install Registry
run: |
kubectl apply -f test/data/registry.yaml
kubectl -n registry rollout status deployment registry --timeout=1m
- name: Install Ko
# This sha corresponds to v0.5
uses: imjasonh/setup-ko@78eea08f10db87a7a23a666a4a6fe2734f2eeb8d
with:
version: v0.11.2
- name: Install Shipwright Build
run: |
make install-controller-kind
kubectl -n shipwright-build rollout status deployment shipwright-build-controller --timeout=1m || true
- name: Test
run: |
export TEST_NAMESPACE=shipwright-build
export TEST_IMAGE_REPO=registry.registry.svc.cluster.local:32222/shipwright-io/build-e2e
export TEST_E2E_TIMEOUT_MULTIPLIER=2
make test-e2e
- name: Build controller logs
if: ${{ failure() }}
run: |
echo "# Pods:"
kubectl -n shipwright-build get pod
PODS=$(kubectl -n shipwright-build get pod -o json)
POD_NAME=$(echo "${PODS}" | jq -r '.items[] | select(.metadata.name | startswith("shipwright-build-controller-")) | .metadata.name')
if [ "${POD_NAME}" != "" ]; then
RESTART_COUNT=$(echo "${PODS}" | jq -r ".items[] | select(.metadata.name == \"${POD_NAME}\") | .status.containerStatuses[0].restartCount")
if [ "${RESTART_COUNT}" != "0" ]; then
echo "# Previous logs:"
kubectl -n shipwright-build logs "${POD_NAME}" --previous || true
fi
echo "# Logs:"
kubectl -n shipwright-build logs "${POD_NAME}"
else
echo "# Pod is missing, there are no logs to retrieve, bailing out..."
kubectl get pod -A
echo "# Events:"
kubectl get events -A

exit 1
fi
- name: Install Tekton
run: |
make kind-tekton
kubectl -n tekton-pipelines rollout status deployment tekton-pipelines-controller --timeout=1m
kubectl -n tekton-pipelines rollout status deployment tekton-pipelines-webhook --timeout=1m
- name: Install Registry
run: |
kubectl apply -f test/data/registry.yaml
kubectl -n registry rollout status deployment registry --timeout=1m
- name: Install Ko
# This sha corresponds to v0.5
uses: imjasonh/setup-ko@78eea08f10db87a7a23a666a4a6fe2734f2eeb8d
with:
version: v0.11.2
- name: Install Shipwright Build
run: |
make install-controller-kind
kubectl -n shipwright-build rollout status deployment shipwright-build-controller --timeout=1m || true
- name: Test
run: |
export TEST_NAMESPACE=shipwright-build
export TEST_IMAGE_REPO=registry.registry.svc.cluster.local:32222/shipwright-io/build-e2e
export TEST_E2E_TIMEOUT_MULTIPLIER=2
make test-e2e
- name: Build controller logs
if: ${{ failure() }}
run: |
echo "# Pods:"
kubectl -n shipwright-build get pod
PODS=$(kubectl -n shipwright-build get pod -o json)
POD_NAME=$(echo "${PODS}" | jq -r '.items[] | select(.metadata.name | startswith("shipwright-build-controller-")) | .metadata.name')
if [ "${POD_NAME}" != "" ]; then
RESTART_COUNT=$(echo "${PODS}" | jq -r ".items[] | select(.metadata.name == \"${POD_NAME}\") | .status.containerStatuses[0].restartCount")
if [ "${RESTART_COUNT}" != "0" ]; then
echo "# Previous logs:"
kubectl -n shipwright-build logs "${POD_NAME}" --previous || true
fi
echo "# Logs:"
kubectl -n shipwright-build logs "${POD_NAME}"
else
echo "# Pod is missing, there are no logs to retrieve, bailing out..."
fi
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ You must install these tools:
1. Follow the instructions in the Kubernetes doc to [Set up a kubernetes cluster](https://kubernetes.io/docs/setup/)
1. Set up a container image repository for pushing images. Any container image registry that is accessible to your cluster can be used for your repository. This can be a public registry like [Docker Hub](https://docs.docker.com/docker-hub/), [quay.io](https://quay.io), or a container registry runs by your cloud provider

**Note**: We support Kubernetes version `1.21` and `1.22`, 1 cluster worker node for basic usage, 2+ cluster worker nodes for HA
**Note**: We support Kubernetes version 1.22, 1.23, and 1.24, 1 cluster worker node for basic usage, 2+ cluster worker nodes for HA

## Environment Setup

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ Shipwright supports any tool that can build container images in Kubernetes clust

## Try It!

- We assume you already have a Kubernetes cluster (v1.21+). If you don't, you can use [KinD](https://kind.sigs.k8s.io), which you can install by running [`./hack/install-kind.sh`](./hack/install-kind.sh).
- We assume you already have a Kubernetes cluster (v1.22+). If you don't, you can use [KinD](https://kind.sigs.k8s.io), which you can install by running [`./hack/install-kind.sh`](./hack/install-kind.sh).

- We also require a Tekton installation (v0.30+). To install the newest supported version, run:
- We also require a Tekton installation (v0.34+). To install the newest supported version, run:

```bash
kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.35.1/release.yaml
kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.38.3/release.yaml
```

- Install the Shipwright deployment. To install the latest version, run:
Expand Down Expand Up @@ -156,8 +156,8 @@ To find out more on what's the best strategy or what else can Shipwright do for

| Dependency | Supported versions |
| -------------------------------------| ---------------------------- |
| [Kubernetes](https://kubernetes.io/) | v1.21.\*, v1.22.\* |
| [Tekton](https://tekton.dev) | v0.30.\*, v0.31.\*, v0.32.\*, v0.33.\*, v0.34.\*, v0.35.\* |
| [Kubernetes](https://kubernetes.io/) | v1.22,\*, v1.23.\*, v1.24.\* |
| [Tekton](https://tekton.dev) | v0.36.\*, v0.37.\*, v0.38.\* |

### Platform support

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/prometheus/client_model v0.2.0
github.com/spf13/cobra v1.5.0
github.com/spf13/pflag v1.0.5
github.com/tektoncd/pipeline v0.35.1
github.com/tektoncd/pipeline v0.38.3
go.uber.org/zap v1.22.0
k8s.io/api v0.23.5
k8s.io/apimachinery v0.23.5
Expand Down
Loading