Added values for watcher

This commit is contained in:
Jonathan Ervine 2020-07-27 16:29:11 +08:00
parent 6bf9ea3979
commit 8d289a67a4
5 changed files with 123 additions and 69 deletions

View File

@ -18,4 +18,6 @@ version: 0.1.0
# This is the version number of the application being deployed. This version number should be # This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. # incremented each time you make changes to the application.
appVersion: 1.16.0 appVersion: v3.10.5
icon: https://github.com/barbequesauce/Watcher3/blob/master/static/images/vector/watcher%20logo%20large.svg

View File

@ -1,55 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "watcher.fullname" . }}
labels:
{{- include "watcher.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "watcher.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "watcher.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "watcher.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

View File

@ -8,8 +8,8 @@ spec:
type: {{ .Values.service.type }} type: {{ .Values.service.type }}
ports: ports:
- port: {{ .Values.service.port }} - port: {{ .Values.service.port }}
targetPort: http targetPort: 9090
protocol: TCP protocol: TCP
name: http name: watcher
selector: selector:
{{- include "watcher.selectorLabels" . | nindent 4 }} {{- include "watcher.selectorLabels" . | nindent 4 }}

View File

@ -0,0 +1,100 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "watcher.fullname" . }}
labels:
{{- include "watcher.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
serviceName: {{ include "watcher.fullname" . }}
selector:
matchLabels:
{{- include "watcher.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "watcher.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "watcher.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: watcher
containerPort: 9090
protocol: TCP
livenessProbe:
httpGet:
path: /
port: 9090
readinessProbe:
httpGet:
path: /
port: 9090
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: app-local-config
mountPath: /config
mountPropagation: HostToContainer
- name: watcher-config
mountPath: /config/backup
subPath: backup
- name: watcher-config
mountPath: /config/posters
subPath: posters
- name: watcher-media-pv
mountPath: /media
- name: {{ .Chart.Name }}-sidecar
image: harbor.ervine.dev/alpine/x86_64/alpine/db-sidecar
imagePullPolicy: Always
securityContext:
privileged: true
lifecycle:
preStop:
exec:
command:
- umount
- /mnt/app-local-config
volumeMounts:
- name: watcher-config
mountPath: /app-remote-config
- name: app-local-config
mountPath: /mnt/app-local-config
mountPropagation: Bidirectional
volumes:
- name: app-local-config
emptyDir: {}
- name: watcher-media-pv
persistentVolumeClaim:
claimName: {{ .Values.mediaPvc }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumeClaimTemplates:
- metadata:
name: watcher-config
spec:
accessModes: ['ReadWriteOnce']
storageClassName: {{ .Values.config.storageClassName | quote }}
resources:
requests:
storage: {{ .Values.config.storageSize }}

View File

@ -5,7 +5,7 @@
replicaCount: 1 replicaCount: 1
image: image:
repository: nginx repository: harbor.ervine.dev/public/x86_64/alpine/watcher
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
imagePullSecrets: [] imagePullSecrets: []
@ -22,17 +22,17 @@ serviceAccount:
podSecurityContext: {} podSecurityContext: {}
# fsGroup: 2000 # fsGroup: 2000
securityContext: {} securityContext:
# capabilities: # capabilities:
# drop: # drop:
# - ALL # - ALL
# readOnlyRootFilesystem: true readOnlyRootFilesystem: true
# runAsNonRoot: true runAsNonRoot: true
# runAsUser: 1000 runAsUser: 1003
service: service:
type: ClusterIP type: ClusterIP
port: 80 port: 9090
ingress: ingress:
enabled: false enabled: false
@ -47,7 +47,7 @@ ingress:
# hosts: # hosts:
# - chart-example.local # - chart-example.local
resources: {} resources:
# We usually recommend not to specify default resources and to leave this as a conscious # We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little # choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following # resources, such as Minikube. If you do want to specify resources, uncomment the following
@ -55,12 +55,19 @@ resources: {}
# limits: # limits:
# cpu: 100m # cpu: 100m
# memory: 128Mi # memory: 128Mi
# requests: requests:
# cpu: 100m cpu: 20m
# memory: 128Mi memory: 64Mi
nodeSelector: {} nodeSelector:
location: livingRoom
tolerations: [] tolerations: []
affinity: {} affinity: {}
config:
storageClassName: nfs-client-hermes
storageSize: 5Gi
mediaPvc: watcher-media-pvc