Skip to content

Commit

Permalink
ci: Create helm chart for BaGetter (bagetter#117)
Browse files Browse the repository at this point in the history
* Created helm chart for BaGetter

* Chart.lock should not be distributed

* Disabled k8s probes

/health endpoint is not released in the latest container image

* Use corrent default health endpoint

The health probes are prepared but commented out. The default endpoint is not /healthz

* Moved chart folder to deployment templates folder

* Update helm chart in release.yml
  • Loading branch information
Khaos66 authored Jul 13, 2024
1 parent 1a6ee81 commit 0f16eaa
Show file tree
Hide file tree
Showing 7 changed files with 222 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,24 @@ jobs:
bagetter/bagetter:${{ needs.version.outputs.RELEASE_VERSION }}
build-args: |
Version=${{ needs.version.outputs.RELEASE_VERSION }}
release_helm_chart:
if: ${{ github.ref_type == 'tag' }}
needs: [version, verify]
name: Release Helm chart to GitHub
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Update version in helm chart
run: |
sed -i "s/version: \".*\"/version: \"${{ needs.version.outputs.RELEASE_VERSION }}\"/" deployment%20templates/chart/bagetter/Chart.yaml
sed -i "s/appVersion: \".*\"/appVersion: \"${{ needs.version.outputs.RELEASE_VERSION }}\"/" deployment%20templates/chart/bagetter/Chart.yaml
- name: Generate helm docs
uses: losisin/helm-docs-github-action@v1
with:
chart-search-root: deployment%20templates
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Release helm chart version ${{ needs.version.outputs.RELEASE_VERSION }}"
file_pattern: 'deployment%20templates/chart/bagetter/Chart.yaml deployment%20templates/chart/bagetter/README.md'
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,7 @@ __pycache__/
**/bagetter.db-wal

.vscode/

# Chart dependencies
charts/
Chart.lock
27 changes: 27 additions & 0 deletions deployment templates/chart/bagetter/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
# OWNERS file for Kubernetes
OWNERS
# helm-docs templates
*.gotmpl
32 changes: 32 additions & 0 deletions deployment templates/chart/bagetter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: v2
name: bagetter
description: A Helm chart for BaGetter nuget package server
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.0.4"

keywords:
- nuget
- baget
- bagetter

home: https://github.com/bagetter/BaGetter/tree/master/charts/BaGetter
# icon:

sources:
- https://github.com/bagetter/BaGetter
- https://hub.docker.com/r/bagetter/bagetter

dependencies:
- name: common
repository: http://bjw-s.github.io/helm-charts/
version: 3.0.3
36 changes: 36 additions & 0 deletions deployment templates/chart/bagetter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# bagetter

![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.0.4](https://img.shields.io/badge/AppVersion-1.0.4-informational?style=flat-square)

A Helm chart for BaGetter nuget package server

**Homepage:** <https://github.com/bagetter/BaGetter/tree/master/charts/BaGetter>

## Source Code

* <https://github.com/bagetter/BaGetter>
* <https://hub.docker.com/r/bagetter/bagetter>

## Requirements

| Repository | Name | Version |
|------------|------|---------|
| http://bjw-s.github.io/helm-charts/ | common | 3.0.3 |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| configMaps | object | See below | environment variables. See more environment variables in the [BaGetter documentation](https://www.bagetter.com/docs/Installation/docker). |
| configMaps.bagetter-env.data.ApiKey | string | `"ChangeMe"` | Set the Nuget API key |
| configMaps.bagetter-env.data.Storage__Type | string | `"FileSystem"` | Set database and storage settings |
| controllers | object | See values.yaml | Configures containers for the chart. |
| controllers.bagetter.containers.bagetter.image.pullPolicy | string | `"IfNotPresent"` | image pull policy |
| controllers.bagetter.containers.bagetter.image.repository | string | `"bagetter/bagetter"` | image repository |
| controllers.bagetter.containers.bagetter.image.tag | string | `"latest"` | image tag |
| ingress | object | See values.yaml | Enable and configure ingress settings for the chart under this key. |
| persistence | object | See values.yaml | Configure persistence settings for the chart under this key. |
| service | object | See values.yaml | Configures service settings for the chart. |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)
5 changes: 5 additions & 0 deletions deployment templates/chart/bagetter/templates/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
{{- include "bjw-s.common.loader.init" . }}

{{/* Render the templates */}}
{{ include "bjw-s.common.loader.generate" . }}
97 changes: 97 additions & 0 deletions deployment templates/chart/bagetter/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/app-template-3.0.1/charts/other/app-template/values.schema.json

#
# IMPORTANT NOTE
#
# This chart inherits from the common library chart. You can check the default values/options here:
# https://github.com/bjw-s/helm-charts/tree/main/charts/library/common/values.yaml
#

# -- environment variables. See more environment variables in the [BaGetter documentation](https://www.bagetter.com/docs/Installation/docker).
# @default -- See below
configMaps:
bagetter-env:
data:
# -- Set the Nuget API key
ApiKey: "ChangeMe"
# -- Set database and storage settings
Storage__Type: "FileSystem"
Storage__Path: "/data"
Database__Type: "Sqlite"
Database__ConnectionString: "Data Source=/data/bagetter.db"
# -- Additional settings. See [BaGetter configuration](https://www.bagetter.com/docs/configuration)
#Mirror__Enabled: "true"
#Mirror__PackageSource: "https://api.nuget.org/v3/index.json"
#PackageDeletionBehavior: "HardDelete"

# -- Configures containers for the chart.
# @default -- See values.yaml
controllers:
bagetter:
containers:
bagetter:
image:
# -- image repository
repository: bagetter/bagetter
# -- image tag
tag: latest
# -- image pull policy
pullPolicy: IfNotPresent
envFrom:
- configMapRef:
name: bagetter-bagetter-env
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 500m
memory: 512Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: false
# probes: # comming with v1.0.5
# liveness:
# enabled: true
# type: HTTP
# path: /health
# readiness:
# enabled: true

# -- Configures service settings for the chart.
# @default -- See values.yaml
service:
bagetter-srv:
controller: bagetter
ports:
http:
port: 8080

# -- Enable and configure ingress settings for the chart under this key.
# @default -- See values.yaml
ingress:
bagetter-ingress:
enabled: false
# className: "ingress-nginx"
hosts: []
# - host: bagetter.mydomain.com
# paths:
# - path: /
# service:
# identifier: bagetter
# port: 8080

# -- Configure persistence settings for the chart under this key.
# @default -- See values.yaml
persistence:
bagetter-data:
enabled: true
accessMode: "ReadWriteOnce"
size: "10Gi"
globalMounts:
- path: "/data"

0 comments on commit 0f16eaa

Please sign in to comment.