-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
feat(charts): sablier helm chart for kube deployement #274
Open
DrummyFloyd
wants to merge
3
commits into
acouvreur:main
Choose a base branch
from
DrummyFloyd:feat-chart
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,12 @@ | ||
--- | ||
remote: origin | ||
target-branch: main | ||
chart-dirs: | ||
- charts | ||
chart-repos: | ||
helm-extra-args: --timeout 180s | ||
check-version-increment: false | ||
validate-maintainers: false | ||
validate-yaml: true | ||
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,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,81 @@ | ||
--- | ||
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 | ||
- name: Create kind cluster | ||
uses: helm/[email protected] | ||
if: steps.list-changed.outputs.changed == 'true' | ||
|
||
- name: Run chart-testing (install) | ||
run: | | ||
namespace=sablier-$(uuidgen) | ||
ct install --namespace=$namespace --config ./.github/configs/ct-install.yaml | ||
if: steps.list-changed.outputs.changed == '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,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 "[email protected]" | ||
|
||
- 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/[email protected] | ||
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 | ||
Check warning Code scanning / SonarCloud Memory limits should be enforced Medium
Specify a memory limit for this container. See more on SonarCloud
|
||
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / SonarCloud
Service account tokens should not be mounted in pods Medium