Skip to content

Commit

Permalink
feat: initial commit for helm deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
wcrum committed Nov 21, 2023
1 parent bfaa981 commit 50c48b3
Show file tree
Hide file tree
Showing 5 changed files with 105 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 SpectroCloud Docs
version: 0.1.0
23 changes: 23 additions & 0 deletions Charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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 }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
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 }}
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: 8000

0 comments on commit 50c48b3

Please sign in to comment.