example(reddit-rss): add custom recipe example: reddit-rss

This commit is contained in:
Masaki Yatsu
2025-09-07 21:48:00 +09:00
parent 87d5cc5c74
commit 6e1ae8b79b
17 changed files with 595 additions and 1 deletions

View File

@@ -0,0 +1,103 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "reddit-rss.fullname" . }}
labels:
{{- include "reddit-rss.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "reddit-rss.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "reddit-rss.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "reddit-rss.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
{{- if .Values.livenessProbe }}
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
{{- end }}
{{- if .Values.readinessProbe }}
readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
env:
- name: OAUTH_CLIENT_ID
valueFrom:
secretKeyRef:
name: auth-config
key: OAUTH_CLIENT_ID
optional: true
- name: OAUTH_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: auth-config
key: OAUTH_CLIENT_SECRET
optional: true
- name: REDDIT_USERNAME
valueFrom:
secretKeyRef:
name: auth-config
key: REDDIT_USERNAME
optional: true
- name: REDDIT_PASSWORD
valueFrom:
secretKeyRef:
name: auth-config
key: REDDIT_PASSWORD
optional: true
- name: USER_AGENT
valueFrom:
secretKeyRef:
name: auth-config
key: USER_AGENT
optional: true
{{- with .Values.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}