-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(csc,argus): release new csc and argus charts (#50)
BREAKING CHANGE: Restructured configuration than old charts
- Loading branch information
1 parent
cd18bb9
commit 0643ce5
Showing
11 changed files
with
180 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
name: K8S Matrix - Helm Lint and Test Charts | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
lint-test: | ||
strategy: | ||
# max-parallel: 5 | ||
matrix: | ||
# k8sVersion: [v1.24.0, v1.23.5, v1.22.7, v1.21.10, v1.20.15, v1.19.16, v1.17.17, v1.16.15, v1.15.12, v1.14.10 ] | ||
# k8sVersion: [v1.24.0, v1.23.5, v1.22.7, v1.21.10, v1.20.15, v1.19.16, v1.18.20, v1.17.17, v1.16.15, v1.15.12, v1.14.10, v1.13.12] | ||
k8sVersion: [ v1.24.0, v1.23.5, v1.22.7, v1.21.10, v1.20.15 ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Helm | ||
uses: azure/setup-helm@v1 | ||
with: | ||
version: v3.4.0 | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
|
||
- name: Set up chart-testing | ||
uses: helm/chart-testing-action@v2.0.1 | ||
|
||
- name: Setup go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.17 | ||
- name: install masterminds/vert | ||
run: go install github.com/Masterminds/vert@latest | ||
- name: setup yq | ||
run: sudo snap install yq | ||
|
||
- name: Run chart-testing (list-changed) | ||
id: list-changed | ||
run: | | ||
changed=$(ct list-changed --config ct.yaml) | ||
if [[ -n "$changed" ]]; then | ||
echo "::set-output name=changed::true" | ||
fi | ||
otherschanged=$(ct list-changed --config ct.yaml || "no change" | egrep -v "argus") | ||
if [[ -n "$otherschanged" ]]; then | ||
echo "::set-output name=otherschanged::true" | ||
fi | ||
arguschanged=$(ct list-changed --config ct.yaml || "no change" | grep argus) | ||
if [[ -n "$arguschanged" ]]; then | ||
echo "::set-output name=arguschanged::true" | ||
fi | ||
- name: Run chart-testing (lint) | ||
run: ct lint --config ct.yaml | ||
|
||
- name: Create kind cluster | ||
uses: helm/kind-action@v1.3.0 | ||
with: | ||
config: kind-conf.yaml | ||
node_image: kindest/node:${{ matrix.k8sVersion }} | ||
if: steps.list-changed.outputs.changed == 'true' | ||
#- name: Pull images beforehand ct install | ||
# run: | | ||
# ksmVersion=$(yq charts/argus/Chart.yaml -o json | jq ".dependencies[] | select(. | .name == \"kube-state-metrics\")" | jq .version | tr -d '"') | ||
# version=$(helm search repo -r prometheus/kube-state-metrics --version $ksmVersion -o json | jq ".[0].app_version" | tr -d '"') | ||
# docker pull k8s.gcr.io/kube-state-metrics/kube-state-metrics:v$version | ||
# cnm=$(kind get clusters) | ||
# kind load docker-image k8s.gcr.io/kube-state-metrics/kube-state-metrics:v$version --name $cnm | ||
# cscVersion=$(yq charts/collectorset-controller/Chart.yaml -o json | jq .appVersion | tr -d '"') | ||
# argusVersion=$(yq charts/argus/Chart.yaml -o json | jq .appVersion | tr -d '"') | ||
# docker pull logicmonitor/collectorset-controller:$cscVersion | ||
# kind load docker-image logicmonitor/collectorset-controller:$cscVersion --name $cnm | ||
# docker pull logicmonitor/argus:$argusVersion | ||
# kind load docker-image logicmonitor/argus:$argusVersion --name $cnm | ||
|
||
- name: Run chart-testing (install) - except argus | ||
if: steps.list-changed.outputs.otherschanged == 'true' | ||
run: | | ||
export K8SVERSION=${{ matrix.k8sVersion }} | ||
while read -r line ; do | ||
echo "installing chart $line" | ||
ct install --config ct.yaml --charts=$line && EXIT_CODE=$(echo $?) || EXIT_CODE=$(echo $?) | ||
if [[ $EXIT_CODE -eq 0 ]] | ||
then | ||
echo "$line is installable on mentioned kubernetes version $K8SVERSION" | ||
else | ||
vc=$(yq $line/Chart.yaml -o json | jq ".kubeVersion" | tr -d '"' | tr -d "'") | ||
echo $vc | ||
v=$(vert "$vc" "$K8SVERSION" || echo "") | ||
if [[ "v$v" == "$K8SVERSION" ]] | ||
then | ||
echo "Error: kubeVersion constraint expects chart to be installed on $K8SVERSION, but it failed to install" | ||
sync | ||
exit 2 | ||
else | ||
echo "installation failed as per constraint" | ||
fi | ||
fi | ||
done < <(ct list-changed --config ct.yaml | egrep -v argus) | ||
- name: Run chart-testing (install) - only argus | ||
if: steps.list-changed.outputs.arguschanged == 'true' | ||
run: | | ||
export K8SVERSION=${{ matrix.k8sVersion }} | ||
vcs=$(vert ">= 1.16.0-0" "$K8SVERSION" || echo "") | ||
if [[ "v$vcs" == "$K8SVERSION" ]] | ||
then | ||
kubectl apply -f charts/collectorset-controller/crds/collectorset.yaml | ||
else | ||
kubectl apply -f v1beta1-cs-crd.yaml | ||
fi | ||
while read -r line ; do | ||
ct install --config ct.yaml --charts=$line && EXIT_CODE=$(echo $?) || EXIT_CODE=$(echo $?) | ||
if [[ $EXIT_CODE -eq 0 ]] | ||
then | ||
echo "$line is installable on mentioned kubernetes version $K8SVERSION" | ||
else | ||
vc=$(yq $line/Chart.yaml -o json | jq ".kubeVersion" | tr -d '"' | tr -d "'") | ||
echo $vc | ||
v=$(vert "$vc" "$K8SVERSION" || echo "") | ||
if [[ "v$v" == "$K8SVERSION" ]] | ||
then | ||
echo "Error: kubeVersion constraint expects chart to be installed on $K8SVERSION, but it failed to install" | ||
sync | ||
exit 3 | ||
else | ||
echo "installation failed as per constraint" | ||
fi | ||
fi | ||
done < <(echo "charts/argus") | ||
if [[ "v$vcs" == "$K8SVERSION" ]] | ||
then | ||
kubectl delete -f charts/collectorset-controller/crds/collectorset.yaml | ||
else | ||
kubectl delete -f v1beta1-cs-crd.yaml | ||
fi | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: 'Close stale issues and PRs' | ||
on: | ||
schedule: | ||
- cron: '0 1 * * *' | ||
|
||
jobs: | ||
stale: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/stale@v3 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
stale-issue-message: 'This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.' | ||
stale-pr-message: 'This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution.' | ||
close-issue-message: 'Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.' | ||
close-pr-message: 'Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Pull Request. Do not hesitate to reopen it later if necessary.' | ||
days-before-stale: 15 | ||
days-before-close: 5 | ||
exempt-issue-labels: 'on-hold' | ||
exempt-pr-labels: 'on-hold' | ||
operations-per-run: 500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,5 @@ clusterName: "dummy" | |
|
||
collector: | ||
size: nano | ||
|
||
probe: | ||
enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
nodes: | ||
- role: control-plane | ||
- role: worker | ||
- role: worker | ||
- role: worker |