forked from kedacore/charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If there is another thing to add to our fork, pls add it here. Example: ``` echo -e "#foo?\n\n bar?" > foo-bar.md # Pls keep adding the changes to standalone files that are not present in the upstream to mitigate the risk of conflict add foo-bar.md git commit -s --ammend yada yada ``` Signed-off-by: Jirka Kremser <[email protected]> Signed-off-by: Jan Wozniak <[email protected]> Signed-off-by: Jirka Kremser <[email protected]>
- Loading branch information
1 parent
5d6d5d1
commit 2ec0107
Showing
9 changed files
with
2,513 additions
and
0 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: Helm Publish | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "target version of either keda (~v2.14.2-1) or http-add-on (v0.8.0-1) helm chart" | ||
required: false | ||
default: 'v2.14.2-2' | ||
type: string | ||
keda: | ||
description: "set this to false if you want to release http-add-on helm chart" | ||
required: false | ||
default: 'true' | ||
type: string | ||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Create k3s cluster | ||
uses: AbsaOSS/k3d-action@v2 | ||
with: | ||
cluster-name: "test-cluster" | ||
k3d-version: v5.6.0 | ||
args: >- | ||
--no-lb | ||
--k3s-arg "--disable=traefik,servicelb,local-storage@server:*" | ||
- name: Smoke test helm rendering and deployability (keda chart) | ||
if: inputs.keda == 'true' | ||
run: | | ||
helm template ./keda \ | ||
-n keda \ | ||
--create-namespace \ | ||
--set customManagedBy=kedify | kubectl apply --server-side --force-conflicts -f - | ||
kubectl wait --timeout=300s -nkeda --for=condition=ready pod -lapp.kubernetes.io/name=keda-admission-webhooks | ||
kubectl wait --timeout=300s -nkeda --for=condition=ready pod -lapp.kubernetes.io/name=keda-operator-metrics-apiserver | ||
kubectl wait --timeout=300s -nkeda --for=condition=ready pod -lapp.kubernetes.io/name=keda-operator | ||
echo -e "\n\n\n pods:\n\n" | ||
kubectl get pods -A | ||
- name: Smoke test helm rendering and deployability (addon chart) | ||
if: inputs.keda != 'true' | ||
run: | | ||
kubectl create ns keda | ||
# addon depends on ScaledObject CRD that is not part of the helm chart so we install also KEDA first | ||
helm template ./keda -nkeda | kubectl apply --server-side --force-conflicts -f - | ||
kubectl scale deploy -nkeda keda-admission-webhooks --replicas=0 | ||
kubectl scale deploy -nkeda keda-operator-metrics-apiserver --replicas=0 | ||
kubectl scale deploy -nkeda keda-operator --replicas=0 | ||
helm template ./http-add-on \ | ||
-n keda \ | ||
--set interceptor.replicas.min=1 \ | ||
--set scaler.replicas=1 \ | ||
--set operator.replicas=1 \ | ||
--set crds.install=true | kubectl apply --server-side --force-conflicts -f - | ||
sleep 10 | ||
kubectl get pods -A | ||
kubectl wait --timeout=600s -nkeda --for=condition=ready pod -lapp.kubernetes.io/component=operator,app.kubernetes.io/part-of=keda-add-ons-http | ||
kubectl wait --timeout=600s -nkeda --for=condition=ready pod -lapp.kubernetes.io/component=scaler,app.kubernetes.io/part-of=keda-add-ons-http | ||
kubectl wait --timeout=600s -nkeda --for=condition=ready pod -lapp.kubernetes.io/component=interceptor,app.kubernetes.io/part-of=keda-add-ons-http | ||
echo -e "\n\n\n pods:\n\n" | ||
kubectl get pods -A | ||
publish: | ||
runs-on: ubuntu-latest | ||
needs: [test] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Add the -N suffix to chart's version (keda) | ||
if: inputs.keda == 'true' | ||
run: | | ||
sed -i keda/Chart.yaml -e 's;^version:.*;version: ${{ inputs.version }};' | ||
- name: Add the -N suffix to chart's version (addon) | ||
if: inputs.keda != 'true' | ||
run: | | ||
sed -i http-add-on/Chart.yaml -e 's;^version:.*;version: ${{ inputs.version }};' | ||
- name: Publish Helm chart | ||
if: inputs.keda != 'true' | ||
uses: stefanprodan/helm-gh-pages@master | ||
with: | ||
token: ${{ secrets.PAT_TOKEN }} | ||
charts_dir: "." | ||
- name: Create k3s cluster | ||
if: inputs.keda == 'true' | ||
uses: AbsaOSS/k3d-action@v2 | ||
with: | ||
cluster-name: "test-cluster" | ||
k3d-version: v5.6.0 | ||
args: >- | ||
--no-lb | ||
--k3s-arg "--disable=traefik,servicelb,local-storage@server:*" | ||
- name: Smoke test helm installation | ||
if: inputs.keda == 'true' | ||
run: | | ||
# exp-backoff - we wait for pages to become available here | ||
for i in $(seq 16) | ||
do | ||
_sec=$(echo "1.5^$i" | bc) | ||
echo "Waiting ${_sec} seconds.." | ||
sleep ${_sec} | ||
helm repo add kedify https://kedify.github.io/charts || continue | ||
helm repo update | ||
set -x | ||
helm upgrade -i keda kedify/keda \ | ||
-n keda \ | ||
--create-namespace \ | ||
--timeout 300s \ | ||
--wait \ | ||
--version ${{ inputs.version }} \ | ||
--set customManagedBy=kedify && break | ||
set +x | ||
[ "$i" = "16" ] && exit 1 | ||
done | ||
kubectl wait --timeout=300s -nkeda --for=condition=ready pod -lapp.kubernetes.io/name=keda-admission-webhooks | ||
kubectl wait --timeout=300s -nkeda --for=condition=ready pod -lapp.kubernetes.io/name=keda-operator-metrics-apiserver | ||
kubectl wait --timeout=300s -nkeda --for=condition=ready pod -lapp.kubernetes.io/name=keda-operator | ||
echo -e "\n\n\n pods:\n\n" | ||
kubectl get pods -A | ||
echo "::group::values.yaml" | ||
helm get values -n keda keda | ||
echo "::endgroup::" | ||
echo "::group::resulting YAML manifests" | ||
helm get manifest -n keda keda | ||
echo "::endgroup::" | ||
echo -e "\n\nthe following command is supposed to fail:\n\n" | ||
helm template keda kedify/keda \ | ||
--version $${{ inputs.version }} \ | ||
--set crds.install=f4lse || true |
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,97 @@ | ||
name: Sync with upstream | ||
on: | ||
schedule: | ||
# ┌───────────── minute (0 - 59) | ||
# │ ┌───────────── hour (0 - 23) | ||
# │ │ ┌───────────── day of the month (1 - 31) | ||
# │ │ │ ┌───────────── month (1 - 12) | ||
# │ │ │ │ ┌───────────── day of the week (0 - 6) | ||
# │ │ │ │ │ | ||
# │ │ │ │ │ | ||
# │ │ │ │ │ | ||
- cron: "* 7 * * *" | ||
workflow_dispatch: | ||
inputs: | ||
upstreamRepo: | ||
description: "Upstream Repo - Where we should get the changes from. If not specified, it's 'kedacore/charts'" | ||
default: "kedacore/charts" | ||
required: false | ||
type: string | ||
downstreamRepo: | ||
description: "Downstream Repo - To what repo we are syncying. If not specified, it's 'kedify/charts' (this repo)" | ||
default: "kedify/charts" | ||
required: false | ||
type: string | ||
|
||
env: | ||
UPSTREAM_REPO: ${{ github.event.inputs.upstreamRepo || 'kedacore/charts' }} | ||
DOWNSTREAM_REPO: ${{ github.event.inputs.downstreamRepo || 'kedify/charts' }} | ||
|
||
jobs: | ||
repo-sync: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.PAT_TOKEN }} | ||
fetch-depth: 0 | ||
- run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Kedify Bot" | ||
git remote add upstream https://github.com/${{ env.UPSTREAM_REPO }}.git | ||
git pull -s recursive --rebase -X ours upstream main | ||
git push origin +main | ||
# - name: Open Pull Request | ||
# id: cpr | ||
# uses: peter-evans/create-pull-request@v6 | ||
# with: | ||
# token: ${{ secrets.PAT_TOKEN }} | ||
# push-to-fork: ${{ env.DOWNSTREAM_REPO }} | ||
# commit-message: Syncing upstream helm charts | ||
# title: Syncing upstream helm charts | ||
# body: | | ||
# :package: Syncing upstream helm chart :package: | ||
|
||
# ### :shipit: Release? | ||
|
||
# The sync mechanism doesn't deal with releases. | ||
|
||
# ### :thinking: Rebase or merge? | ||
|
||
# Although merging is obviously better :trollface:, let's use rebasing for this sync. | ||
# This way we will see our custom tweaks nicely on the tip of the `main`. | ||
|
||
# ### :hospital: Conflict? | ||
|
||
# This could have happened only if the PR was opened for a long time and meanwhile there | ||
# was a change to this repo. :adhesive_bandage: Just close this PR and wait for the next one. | ||
|
||
# #### :bulb: Tip | ||
|
||
# Ideally, this repo has only one commits with all the necessary tweaks in it (like this gh action for instance). | ||
# So that we can keep adding the changes to this commit by `g commit --ammend` and ideally the changes should be in | ||
# new files so that the risk of conflict with the upstream repo is minimal. | ||
|
||
# ### :wrench: Important | ||
|
||
# Once this is merged, please don't forget to run this command if our 'All our tweaks should go here' commit is not on | ||
# top: | ||
|
||
# ``` | ||
# GIT_SEQUENCE_EDITOR=\"sed -i -n 'h;1n;2p;g;p'\" git rebase -i HEAD~2 | ||
# ``` | ||
|
||
# To reorder last two commits. | ||
|
||
# This automated PR was created by [this action][1]. | ||
|
||
# [1]: https://github.com/kedify/charts/actions/runs/${{ github.run_id }} | ||
# branch: upstream-sync | ||
# delete-branch: true | ||
# signoff: true | ||
|
||
# - name: Check PR | ||
# run: | | ||
# echo ":rocket:" | ||
# echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | tee -a "${GITHUB_STEP_SUMMARY}" | ||
# echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" | tee -a "${GITHUB_STEP_SUMMARY}" |
Validating CODEOWNERS rules …
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,5 @@ | ||
# Teams: | ||
* @kedify/all | ||
|
||
# Individuals: | ||
|
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
22 changes: 22 additions & 0 deletions
22
http-add-on/templates/interceptor/service-kedify_proxy_sink.yaml
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,22 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: interceptor-proxy | ||
{{- include "keda-http-add-on.labels" . | indent 4 }} | ||
name: "{{ .Chart.Name }}-interceptor-kedify-proxy-metric-sink" | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- name: proxy | ||
port: {{ default 9901 .Values.interceptor.proxy.kedifyMetricsSinkPort }} | ||
protocol: TCP | ||
targetPort: {{ default 9901 .Values.interceptor.proxy.kedifyMetricsSinkPort }} | ||
- name: control-plane | ||
port: {{ default 5678 .Values.interceptor.proxy.kedifyEnvoyControlPlanePort }} | ||
protocol: TCP | ||
targetPort: {{ default 5678 .Values.interceptor.proxy.kedifyEnvoyControlPlanePort }} | ||
selector: | ||
app.kubernetes.io/component: interceptor | ||
{{- include "keda-http-add-on.matchLabels" . | indent 4 }} |
Oops, something went wrong.