This commit is contained in:
Martyn 2023-11-26 13:24:48 +00:00
parent 0ded93e55a
commit 9054963452
9 changed files with 252 additions and 0 deletions

23
apps-helm/hyperion/.helmignore Executable file
View File

@ -0,0 +1,23 @@
# 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/

21
apps-helm/hyperion/Chart.yaml Executable file
View File

@ -0,0 +1,21 @@
apiVersion: v2
name: hyperion
description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
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: "0.1.0"

View File

@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "hyperion.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "hyperion.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "hyperion.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "hyperion.labels" -}}
helm.sh/chart: {{ include "hyperion.chart" . }}
{{ include "hyperion.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "hyperion.selectorLabels" -}}
app.kubernetes.io/name: {{ include "hyperion.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "hyperion.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "hyperion.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,15 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "hyperion.fullname" . }}-claim
labels:
app: hyperion
{{- include "hyperion.labels" . | nindent 4 }}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.pvc.claim.storageRequest | quote }}
storageClassName: {{ .Values.pvc.claim.storageClass | quote }}
volumeMode: Filesystem

View File

@ -0,0 +1,17 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: {{ include "hyperion.fullname" . }}-data
labels:
{{- include "hyperion.labels" . | nindent 4 }}
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 100Mi
hostPath:
path: /home/hyperion
type: DirectoryOrCreate
persistentVolumeReclaimPolicy: Delete
storageClassName: local
volumeMode: Filesystem

View File

@ -0,0 +1,52 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "hyperion.fullname" . }}-hyperion
labels:
app: hyperion
{{- include "hyperion.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.hyperion.replicas }}
selector:
matchLabels:
app: hyperion
{{- include "hyperion.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
app: hyperion
{{- include "hyperion.selectorLabels" . | nindent 8 }}
spec:
containers:
- command:
- /usr/bin/hyperiond
- --userdata
- /root/.hyperion
env:
- name: KUBERNETES_CLUSTER_DOMAIN
value: {{ .Values.kubernetesClusterDomain }}
image: {{ .Values.hyperion.hyperion.image.repository }}:{{ .Values.hyperion.hyperion.image.tag
| default .Chart.AppVersion }}
imagePullPolicy: IfNotPresent
name: hyperion
ports:
- containerPort: 19445
hostPort: 19445
protocol: TCP
- containerPort: 19444
hostPort: 19444
protocol: TCP
- containerPort: 8090
hostPort: 8090
protocol: TCP
resources: {}
volumeMounts:
- mountPath: /root/.hyperion
name: data
dnsPolicy: ClusterFirst
hostNetwork: true
restartPolicy: Always
volumes:
- name: data
persistentVolumeClaim:
claimName: {{ include "hyperion.fullname" . }}-claim

View File

@ -0,0 +1,29 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: hyperion
{{- include "hyperion.labels" . | nindent 4 }}
name: hyperion
namespace: hyperion
spec:
internalTrafficPolicy: Cluster
ports:
- name: web
nodePort: 30419
port: 80
targetPort: 8090
- name: json
nodePort: 31201
port: 19444
- name: flatbuffers
nodePort: 31448
port: 19400
- name: protobuf
nodePort: 32039
port: 19445
selector:
app: hyperion
app.kubernetes.io/instance: hyperion
app.kubernetes.io/name: hyperion
type: {{ .Values.service.type }}

View File

@ -0,0 +1,13 @@
hyperion:
hyperion:
image:
repository: sirfragalot/hyperion.ng
tag: 2.0.15
replicas: 1
kubernetesClusterDomain: cluster.local
pvc:
claim:
storageClass: local
storageRequest: 100Mi
service:
type: LoadBalancer

View File

@ -0,0 +1,20 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: hyperion
namespace: argocd
spec:
destination:
namespace: hyperion
server: https://kubernetes.default.svc
project: apps
source:
helm:
parameters:
- name: hyperion.hyperion.image.tag
value: 2.0.15
- name: pvc.claim.storageClass
value: local-path-fast
path: helm/hyperion
repoURL: https://git.martyn.berlin/martyn/infra4talos.git
targetRevision: HEAD