Skip to content

Commit f043108

Browse files
Merge pull request #2 from fetch-rewards/gh-pages
[GH-PAGES] initial version of helm for testing purpose
2 parents cde63fc + 65f52a0 commit f043108

File tree

8 files changed

+259
-0
lines changed

8 files changed

+259
-0
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release Charts
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Configure Git
18+
run: |
19+
git config user.name "$GITHUB_ACTOR"
20+
git config user.email "[email protected]"
21+
22+
- name: Run chart-releaser
23+
uses: helm/[email protected]
24+
env:
25+
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,25 @@ Currently users must specify four pieces of config:
3131

3232
![Architecture](docs/imgs/architecture.png)
3333

34+
35+
36+
## Helm Usage
37+
38+
[Helm](https://helm.sh) must be installed to use the charts. Please refer to
39+
Helm's [documentation](https://helm.sh/docs) to get started.
40+
41+
Once Helm has been set up correctly, add the repo as follows:
42+
43+
helm repo add <alias> https://<orgname>.github.io/helm-charts
44+
45+
If you had already added this repo earlier, run `helm repo update` to retrieve
46+
the latest versions of the packages. You can then run `helm search repo
47+
<alias>` to see the charts.
48+
49+
To install the <chart-name> chart:
50+
51+
helm install my-<chart-name> <alias>/<chart-name>
52+
53+
To uninstall the chart:
54+
55+
helm delete my-<chart-name>

charts/streamlit-chart/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

charts/streamlit-chart/Chart.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: streamlit-chart
3+
description: A Helm chart for Kubernetes
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: "1.16.0"
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "streamlit-chart.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "streamlit-chart.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "streamlit-chart.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "streamlit-chart.labels" -}}
37+
helm.sh/chart: {{ include "streamlit-chart.chart" . }}
38+
{{ include "streamlit-chart.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "streamlit-chart.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "streamlit-chart.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "streamlit-chart.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "streamlit-chart.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: streamlit
5+
labels:
6+
name: streamlit
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: "{{ include "streamlit-chart.fullname" . }}-test-connection"
5+
labels:
6+
{{- include "streamlit-chart.labels" . | nindent 4 }}
7+
annotations:
8+
"helm.sh/hook": test
9+
spec:
10+
containers:
11+
- name: wget
12+
image: busybox
13+
command: ['wget']
14+
args: ['{{ include "streamlit-chart.fullname" . }}:{{ .Values.service.port }}']
15+
restartPolicy: Never

charts/streamlit-chart/values.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Default values for streamlit-chart.
2+
# This is a YAML-formatted file.
3+
# Declare variables to be passed into your templates.
4+
5+
# replicaCount: 1
6+
7+
# image:
8+
# repository: nginx
9+
# pullPolicy: IfNotPresent
10+
# # Overrides the image tag whose default is the chart appVersion.
11+
# tag: ""
12+
13+
# imagePullSecrets: []
14+
# nameOverride: ""
15+
# fullnameOverride: ""
16+
17+
# serviceAccount:
18+
# # Specifies whether a service account should be created
19+
# create: true
20+
# # Annotations to add to the service account
21+
# annotations: {}
22+
# # The name of the service account to use.
23+
# # If not set and create is true, a name is generated using the fullname template
24+
# name: ""
25+
26+
# podAnnotations: {}
27+
28+
# podSecurityContext: {}
29+
# # fsGroup: 2000
30+
31+
# securityContext: {}
32+
# # capabilities:
33+
# # drop:
34+
# # - ALL
35+
# # readOnlyRootFilesystem: true
36+
# # runAsNonRoot: true
37+
# # runAsUser: 1000
38+
39+
# service:
40+
# type: ClusterIP
41+
# port: 80
42+
43+
# ingress:
44+
# enabled: false
45+
# className: ""
46+
# annotations: {}
47+
# # kubernetes.io/ingress.class: nginx
48+
# # kubernetes.io/tls-acme: "true"
49+
# hosts:
50+
# - host: chart-example.local
51+
# paths:
52+
# - path: /
53+
# pathType: ImplementationSpecific
54+
# tls: []
55+
# # - secretName: chart-example-tls
56+
# # hosts:
57+
# # - chart-example.local
58+
59+
# resources: {}
60+
# # We usually recommend not to specify default resources and to leave this as a conscious
61+
# # choice for the user. This also increases chances charts run on environments with little
62+
# # resources, such as Minikube. If you do want to specify resources, uncomment the following
63+
# # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
64+
# # limits:
65+
# # cpu: 100m
66+
# # memory: 128Mi
67+
# # requests:
68+
# # cpu: 100m
69+
# # memory: 128Mi
70+
71+
# autoscaling:
72+
# enabled: false
73+
# minReplicas: 1
74+
# maxReplicas: 100
75+
# targetCPUUtilizationPercentage: 80
76+
# # targetMemoryUtilizationPercentage: 80
77+
78+
# nodeSelector: {}
79+
80+
# tolerations: []
81+
82+
# affinity: {}

0 commit comments

Comments
 (0)