Skip to content

Commit

Permalink
Helm Chart Deployments (#1833) (#1836)
Browse files Browse the repository at this point in the history
* feat: initial commit for helm deployments

* fix: corrections

---------

Co-authored-by: Karl Cardenas <[email protected]>
(cherry picked from commit 67fd13f)

Co-authored-by: Will <[email protected]>
  • Loading branch information
1 parent 3c320bc commit f9e652b
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Charts/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v2
name: spectrocloud-librarium
description: A Helm chart for deploying Spectro Cloud documentation offline.
version: 0.1.0
29 changes: 29 additions & 0 deletions Charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Chart.Name }}
labels:
app: {{ .Chart.Name }}
group: {{ .Chart.Name }}
spec:
replicas: 1
selector:
matchLabels:
app: {{ .Chart.Name }}
template:
metadata:
labels:
app: {{ .Chart.Name }}
group: {{ .Chart.Name }}
spec:
serviceAccountName: restart-docs
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
livenessProbe:
httpGet:
path: /
port: {{ .Values.service.port }}
failureThreshold: 1
periodSeconds: 60
terminationGracePeriodSeconds: 60
55 changes: 55 additions & 0 deletions Charts/templates/job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: restart-docs
namespace: {{ .Chart.Name }}
spec:
concurrencyPolicy: Forbid
schedule: '0 0 * * *'
jobTemplate:
spec:
backoffLimit: 2
activeDeadlineSeconds: 600
template:
spec:
serviceAccountName: restart-docs
restartPolicy: Never
containers:
- name: kubectl
image: bitnami/kubectl
command:
- 'kubectl'
- 'rollout'
- 'restart'
- 'deployment/{{ .Chart.Name }}'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: restart-docs
namespace: {{ .Chart.Name }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: restart-docs
subjects:
- kind: ServiceAccount
name: restart-docs
namespace: {{ .Chart.Name }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: restart-docs
namespace: {{ .Chart.Name }}
rules:
- apiGroups: ["apps", "extensions"]
resources: ["deployments"]
resourceNames: ["{{ .Chart.Name }}"]
verbs: ["get", "patch"]
---
kind: ServiceAccount
apiVersion: v1
metadata:
name: restart-docs
namespace: {{ .Chart.Name }}
6 changes: 6 additions & 0 deletions Charts/templates/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Namespace
apiVersion: v1
metadata:
name: {{ .Chart.Name }}
labels:
name: {{ .Chart.Name }}
13 changes: 13 additions & 0 deletions Charts/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Chart.Name }}
labels:
group: {{ .Chart.Name }}
spec:
type: ClusterIP
selector:
app: restart-docs
ports:
- port: {{ .Values.service.port }}
targetPort: 80
10 changes: 10 additions & 0 deletions Charts/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
replicaCount: 1

image:
repository: ghcr.io/spectrocloud/librarium
tag: "nightly"
pullPolicy: Always

service:
type: ClusterIP
port: 8080

0 comments on commit f9e652b

Please sign in to comment.