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

add TEKTON support #60

Merged
merged 3 commits into from
Mar 3, 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
75 changes: 46 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,46 +23,63 @@ jobs:
SHELLCHECK_OPTS: -x

# test local cluster without prometheus grafana
test_local_cluster_without_prometheus_grafana:
test_local_cluster:
needs:
- shellcheck
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# I suppose we'd better update version pre kepler release.
# keep from current default version and latest version.
cluster_provider: [kind, microshift]
# So far we just have a single version for microshift
# in the future, we should considering have a local test for each cluster providers
include:
- cluster_provider: kind
prometheus_operator_version: v0.12.0
PROMETHEUS_ENABLE: false
GRAFANA_ENABLE: false
TEKTON_ENABLE: false
- cluster_provider: kind
prometheus_operator_version: v0.12.0
PROMETHEUS_ENABLE: true
GRAFANA_ENABLE: true
TEKTON_ENABLE: false
- cluster_provider: kind
prometheus_operator_version: v0.12.0
PROMETHEUS_ENABLE: false
GRAFANA_ENABLE: false
TEKTON_ENABLE: true
- cluster_provider: kind
prometheus_operator_version: v0.12.0
PROMETHEUS_ENABLE: true
GRAFANA_ENABLE: true
TEKTON_ENABLE: true
- cluster_provider: microshift
prometheus_operator_version: v0.12.0
PROMETHEUS_ENABLE: false
GRAFANA_ENABLE: false
TEKTON_ENABLE: false
- cluster_provider: microshift
prometheus_operator_version: v0.12.0
PROMETHEUS_ENABLE: true
GRAFANA_ENABLE: true
TEKTON_ENABLE: false
- cluster_provider: microshift
prometheus_operator_version: v0.12.0
PROMETHEUS_ENABLE: false
GRAFANA_ENABLE: false
TEKTON_ENABLE: true
- cluster_provider: microshift
prometheus_operator_version: v0.12.0
PROMETHEUS_ENABLE: true
GRAFANA_ENABLE: true
TEKTON_ENABLE: true
steps:
- uses: actions/checkout@v3
- name: start from local
run: |
export CLUSTER_PROVIDER=${{matrix.cluster_provider}}
./main.sh up
- name: verify
run: |
export CLUSTER_PROVIDER=${{matrix.cluster_provider}}
./verify.sh

# test local cluster with prometheus grafana
test_local_cluster_with_prometheus_grafana:
runs-on: ubuntu-latest
needs: test_local_cluster_without_prometheus_grafana
strategy:
matrix:
# I suppose we'd better update version pre kepler release.
# keep from current default version and latest version.
cluster_provider: [kind, microshift]
prometheus_operator_version: [v0.12.0]
steps:
- uses: actions/checkout@v3
- name: start from local
run: |
export PROMETHEUS_ENABLE=true
export PROMETHEUS_ENABLE=${{matrix.PROMETHEUS_ENABLE}}
export PROMETHEUS_OPERATOR_VERSION=${{matrix.prometheus_operator_version}}
export GRAFANA_ENABLE=true
export GRAFANA_ENABLE=${{matrix.GRAFANA_ENABLE}}
export CLUSTER_PROVIDER=${{matrix.cluster_provider}}
export TEKTON_ENABLE=${{matrix.TEKTON_ENABLE}}
./main.sh up
- name: verify
run: |
Expand Down
9 changes: 9 additions & 0 deletions lib/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# Copyright 2023 The Kepler Contributors
#

# shellcheck disable=SC2086
err() {
echo -e "ERROR: $*\n" >&2
}
Expand Down Expand Up @@ -143,3 +144,11 @@ run_container() {
"$@" \
"$img"
}

rollout_ns_status() {
local resources
resources=$(kubectl get deployments,statefulsets,daemonsets -n=$1 -o name)
for res in $resources; do
kubectl rollout status $res --namespace $1 --timeout=10m || die "failed to check status of ${res} inside namespace ${1}"
done
}
10 changes: 10 additions & 0 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ declare -r REGISTRY_PORT=${REGISTRY_PORT:-5001}

declare -r PROMETHEUS_ENABLE=${PROMETHEUS_ENABLE:-false}
declare -r GRAFANA_ENABLE=${GRAFANA_ENABLE:-false}
declare -r TEKTON_ENABLE=${TEKTON_ENABLE:-false}

source "$PROJECT_ROOT/lib/utils.sh"

Expand All @@ -68,6 +69,12 @@ cluster_up() {
source "$PROJECT_ROOT/lib/prometheus.sh"
deploy_prometheus_operator
fi

if is_set "$TEKTON_ENABLE"; then
kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml
rollout_ns_status tekton-pipelines
rollout_ns_status tekton-pipelines-resolvers
fi
}

cluster_down() {
Expand Down Expand Up @@ -97,6 +104,9 @@ print_config() {
* Install Prometheus : $prom_install_msg
* Install Grafana : $GRAFANA_ENABLE

Tekton
* Install Tekton : $TEKTON_ENABLE

$cluster_config
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Expand Down
Loading