Skip to content

Commit

Permalink
Might help if I actually add the files
Browse files Browse the repository at this point in the history
  • Loading branch information
JessieAMorris committed Dec 6, 2024
1 parent a190091 commit d6f80c8
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/philter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ 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.8
version: 0.1.9

# 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
Expand Down
22 changes: 22 additions & 0 deletions charts/philter/templates/ph-eye/_helpers-ph-eye.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{/*
phEye fullname
*/}}
{{- define "philter.phEyeFullname" -}}
{{ include "philter.fullname" . }}-ph-eye-1
{{- end }}

{{/*
phEye common labels
*/}}
{{- define "philter.phEyeLabels" -}}
{{ include "philter.labels" . }}
{{ include "philter.phEyeSelectorLabels" . }}
{{- end }}

{{/*
phEye selector labels
*/}}
{{- define "philter.phEyeSelectorLabels" -}}
{{ include "philter.selectorLabels" . }}
app.kubernetes.io/component: ph-eye
{{- end }}
79 changes: 79 additions & 0 deletions charts/philter/templates/ph-eye/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{{- if .Values.phEye.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "philter.phEyeFullname" . }}
labels:
{{- include "philter.labels" . | nindent 4 }}
spec:
{{- if not .Values.phEye.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "philter.phEyeSelectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.phEye.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "philter.phEyeLabels" . | nindent 8 }}
{{- with .Values.phEye.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "philter.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.phEye.podSecurityContext | nindent 8 }}
containers:
- name: philter-ph-eye
securityContext:
{{- toYaml .Values.phEye.securityContext | nindent 12 }}
image: "{{ .Values.phEye.image.repository }}:{{ .Values.phEye.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.phEye.image.pullPolicy }}
{{- with .Values.phEye.env }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.phEye.service.port }}
protocol: TCP
livenessProbe:
{{- toYaml .Values.phEye.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .Values.phEye.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.phEye.resources | nindent 12 }}
{{- with .Values.phEye.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.phEye.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.phEye.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.phEye.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.phEye.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

{{- with .Values.phEye.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
34 changes: 34 additions & 0 deletions charts/philter/templates/ph-eye/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{- if .Values.phEye.enabled }}
{{- if .Values.phEye.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "philter.phEyeFullname" . }}
labels:
{{- include "philter.phEyeLabels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "philter.phEyeFullname" . }}
minReplicas: {{ .Values.phEye.autoscaling.minReplicas }}
maxReplicas: {{ .Values.phEye.autoscaling.maxReplicas }}
metrics:
{{- if .Values.phEye.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.phEye.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.phEye.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.phEye.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
{{- end }}
17 changes: 17 additions & 0 deletions charts/philter/templates/ph-eye/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.phEye.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "philter.phEyeFullname" . }}
labels:
{{- include "philter.phEyeLabels" . | nindent 4 }}
spec:
type: {{ .Values.phEye.service.type }}
ports:
- port: {{ .Values.phEye.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "philter.phEyeSelectorLabels" . | nindent 4 }}
{{- end }}
17 changes: 17 additions & 0 deletions charts/philter/templates/ph-eye/tests/test-connection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.phEye.enabled }}
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "philter.phEyeFullname" . }}-test-connection"
labels:
{{- include "philter.phEyeLabels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "philter.phEyeFullname" . }}:{{ .Values.phEye.service.port }}']
restartPolicy: Never
{{- end }}

0 comments on commit d6f80c8

Please sign in to comment.