forked from sablierapp/sablier
-
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.
feat(charts): sablier helm chart for kube deployement
Closed: sablierapp#271
- Loading branch information
1 parent
dda8cae
commit 707cb60
Showing
14 changed files
with
664 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,9 @@ | ||
--- | ||
remote: origin | ||
target-branch: main | ||
chart-dirs: | ||
- charts | ||
check-version-increment: false | ||
validate-maintainers: false | ||
exclude-deprecated: true | ||
excluded-charts: [] |
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,72 @@ | ||
--- | ||
name: "Lint and Test Chart" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
linter-artifacthub: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: public.ecr.aws/artifacthub/ah:v1.14.0 | ||
options: --user 1001 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Run ah lint | ||
working-directory: ./charts | ||
run: ah lint | ||
|
||
lint-and-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Helm | ||
uses: azure/setup-helm@v4 | ||
|
||
- name: Set up python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.9" | ||
|
||
- name: Run helm unittest | ||
uses: d3adb5/helm-unittest-action@v2 | ||
with: | ||
github-token: ${{ secrets.GH_TOKEN }} | ||
charts: charts/sablier | ||
|
||
- name: Setup Chart Linting | ||
id: lint | ||
uses: helm/chart-testing-action@v2 | ||
|
||
- name: List changed charts | ||
id: list-changed | ||
run: | | ||
changed=$(ct --config ./.github/configs/ct-lint.yaml list-changed) | ||
charts=$(echo "$changed" | tr '\n' ' ' | xargs) | ||
if [[ -n "$changed" ]]; then | ||
echo "changed=true" >> $GITHUB_OUTPUT | ||
echo "changed_charts=$charts" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Run chart-testing (lint) | ||
run: ct lint --debug --config ./.github/configs/ct-lint.yaml | ||
|
||
- name: Run docs-testing (helm-docs) | ||
id: helm-docs | ||
run: | | ||
./scripts/helm-docs.sh | ||
if [[ $(git diff --stat) != '' ]]; then | ||
echo -e '\033[0;31mDocumentation outdated!\033[0m ❌' | ||
git diff --color | ||
exit 1 | ||
else | ||
echo -e '\033[0;32mDocumentation up to date\033[0m ✔' | ||
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,57 @@ | ||
name: Release Charts | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_call: | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Configure Git | ||
run: | | ||
git config --global user.name "$GITHUB_ACTOR" | ||
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com" | ||
- name: Set up Helm | ||
uses: azure/setup-helm@v4 | ||
|
||
- id: generate_token | ||
uses: tibdex/github-app-token@v2 | ||
with: | ||
app_id: ${{ secrets.GH_APP_ID }} | ||
private_key: ${{ secrets.GH_APP_PRIVATE_KEY }} | ||
|
||
- name: Run chart-releaser | ||
uses: helm/chart-releaser-action@v1.6.0 | ||
env: | ||
CR_TOKEN: ${{ steps.generate_token.outputs.token }} | ||
CR_SKIP_EXISTING: "true" | ||
CR_GENERATE_RELEASE_NOTES: "true" | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GH_TOKEN }} | ||
|
||
- name: Push Charts to GHCR | ||
run: | | ||
for pkg in .cr-release-packages/*; do | ||
if [ -z "${pkg:-}" ]; then | ||
break | ||
fi | ||
helm push "${pkg}" oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/helm-charts | ||
done |
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,14 @@ | ||
apiVersion: v2 | ||
name: sablier | ||
description: An free and open-source software to start workloads on demand and stop them after a period of inactivity. | ||
type: application | ||
version: "0.1.0" | ||
appVersion: 1.6.0 | ||
deprecated: false | ||
sources: | ||
- "https://github.com/acouvreur/sablier" | ||
keywords: | ||
- Orchestration & Management | ||
maintainers: | ||
- email: TODO | ||
name: TODO |
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,34 @@ | ||
# sablier | ||
|
||
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.6.0](https://img.shields.io/badge/AppVersion-1.6.0-informational?style=flat-square) | ||
|
||
An free and open-source software to start workloads on demand and stop them after a period of inactivity. | ||
|
||
## Maintainers | ||
|
||
| Name | Email | Url | | ||
| ---- | ------ | --- | | ||
| TODO | <TODO> | | | ||
|
||
## Source Code | ||
|
||
* <https://github.com/acouvreur/sablier> | ||
|
||
## Values | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| deploymentAnnotations | object | `{}` | Annotations for all deployed Deployments | | ||
| deploymentLabels | object | `{}` | Labels for all deployed Deployments | | ||
| deploymentStrategy | object | `{"rollingUpdate":{"maxSurge":"25%","maxUnavailable":"25%"},"type":"RollingUpdate"}` | Deployment strategy for all deployed Deployments | | ||
| image.repository | string | `"acouvreur/sablier"` | Sablier image repository | | ||
| image.tag | string | `""` | Sablier image tag (deafult) appVersion | | ||
| imagePullPolicy | string | `"IfNotPresent"` | Sablier imagePullPolicy | | ||
| livenessProbe | object | `{"failureThreshold":3,"httpGet":{"path":"/healthz","port":10000},"initialDelaySeconds":5,"periodSeconds":5,"successThreshold":1,"timeoutSeconds":1}` | Sablier livenessProbe | | ||
| logLevel | string | `"trace"` | Sablier log level | | ||
| podAnnotations | object | `{}` | Annotations for all deployed pods | | ||
| podLabels | object | `{}` | Labels for all deployed pods | | ||
| readinessProbe | object | `{"failureThreshold":3,"httpGet":{"path":"/healthz","port":10000},"initialDelaySeconds":5,"periodSeconds":5,"successThreshold":1,"timeoutSeconds":1}` | Sablier readinessProbe | | ||
| replicas | int | `1` | Sablier's replicas | | ||
| resources | object | `{}` | Resource limits and requests for sablier | | ||
|
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,53 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: sablier-{{ .Release.Name }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
app: sablier-{{ .Release.Name }} | ||
{{- with .Values.deploymentLabels }} | ||
{{ toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.deploymentAnnotations }} | ||
annotations: | ||
{{ toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
replicas: {{ .Values.replicas }} | ||
{{- with .Values.deploymentStrategy }} | ||
strategy: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
selector: | ||
matchLabels: | ||
app: sablier-{{ .Release.Name }} | ||
template: | ||
metadata: | ||
labels: | ||
app: sablier-{{ .Release.Name }} | ||
{{- with .Values.podLabels }} | ||
{{ toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{ toYaml . | nindent 8 }} | ||
{{- end }} | ||
spec: | ||
serviceAccountName: sablier-{{ .Release.Name }} | ||
containers: | ||
- name: sablier | ||
image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}" | ||
imagePullPolicy: IfNotPresent | ||
args: ["start", "--provider.name=kubernetes", "--logging.level={{ .Values.logLevel}}"] | ||
ports: | ||
- containerPort: 10000 | ||
{{- with .Values.livenessProbe }} | ||
livenessProbe: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- with .Values.readinessProbe }} | ||
readinessProbe: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} |
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,33 @@ | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: sablier-{{ .Release.Name }} | ||
rules: | ||
- apiGroups: | ||
- apps | ||
- "" | ||
resources: | ||
- deployments | ||
- deployments/scale | ||
- statefulsets | ||
- statefulsets/scale | ||
verbs: | ||
- patch # Scale up and down | ||
- get # Retrieve info about specific dep | ||
- update # Scale up and down | ||
- list # Events | ||
- watch # Events | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: sablier-{{ .Release.Name }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: sablier-{{ .Release.Name }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: sablier | ||
namespace: {{ .Release.Namespace }} |
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,6 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: sablier-{{ .Release.Name }} | ||
namespace: {{ .Release.Namespace }} |
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,13 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: sablier-{{ .Release.Name }} | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
selector: | ||
app: sablier-{{ .Release.Name }} | ||
ports: | ||
- protocol: TCP | ||
port: 10000 | ||
targetPort: 10000 |
Oops, something went wrong.