Skip to content

Commit

Permalink
add helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
Woozl committed May 7, 2024
1 parent 45d04be commit 63e43c3
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 0 deletions.
8 changes: 8 additions & 0 deletions kubernetes/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: bdc-program-studies
apiVersion: v2
version: 1.0.0
type: application
description: Studies viewer for BDC programs.
maintainers:
- name: David Glymph
email: [email protected]
13 changes: 13 additions & 0 deletions kubernetes/templates/_labels.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# common labels
{{- define "labels" -}}
{{ include "selectorLabels" . }}

helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

# selector labels
{{- define "selectorLabels" -}}
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
43 changes: 43 additions & 0 deletions kubernetes/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Chart.Name }}
labels:
{{- include "labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "selectorLabels" . | nindent 8 }}
spec:
containers:
- name: {{ .Chart.Name }}
image: {{ printf "%s:%s" .Values.image.repository .Values.image.tag }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
env:
{{- toYaml .Values.env | nindent 12 }}
startupProbe:
httpGet:
path: /
port: http
failureThreshold: 30
periodSeconds: 10
livenessProbe:
httpGet:
path: /
port: http
periodSeconds: 15
readinessProbe:
httpGet:
path: /
port: http
periodSeconds: 15
31 changes: 31 additions & 0 deletions kubernetes/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Chart.Name }}
annotations:
# This line will automatically generate a Let's Encrypt TLS certificate which will be stored in the secretName below. See https://cert-manager.io/docs/usage/ingress/
# This only works for DNS names in public zones like *.renci.org or *.apps.renci.org. See https://wiki.renci.org/index.php/Kubernetes_Cloud/Let%27s_Encrypt_Migration
cert-manager.io/cluster-issuer: letsencrypt

{{ if .Values.ingress.public }}
nginx.ingress.kubernetes.io/whitelist-source-range: "0.0.0.0/0,::/0"
{{ end }}

spec:
{{ if .Values.ingress.tls }}
tls:
- hosts:
- {{ .Values.ingress.host }}
secretName: {{ .Values.ingress.host }}-tls
{{ end }}
rules:
- host: {{ .Values.ingress.host }}
http:
paths:
- path: {{ .Values.ingress.path }}
pathType: Prefix
backend:
service:
name: {{ .Chart.Name }}
port:
number: {{ .Values.service.port }}
16 changes: 16 additions & 0 deletions kubernetes/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Chart.Name }}
labels:
{{- include "labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
23 changes: 23 additions & 0 deletions kubernetes/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
replicaCount: 1

image:
repository: ghcr.io/stagecc/bdc-program-studies
tag: "1.0.1"

resources:
limits:
cpu: 250m
memory: 256Mi
requests:
cpu: 100m
memory: 128Mi

service:
type: ClusterIP
port: 8080

ingress:
host: bdc-program-studies.apps.renci.org
path: /
tls: true
public: false

0 comments on commit 63e43c3

Please sign in to comment.