Skip to content

Commit

Permalink
add TEKTON support
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Yuan <[email protected]>
  • Loading branch information
SamYuan1990 committed Mar 3, 2024
1 parent 8262537 commit d37f226
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 29 deletions.
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
8 changes: 8 additions & 0 deletions lib/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,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.yamls
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

0 comments on commit d37f226

Please sign in to comment.