This commit is contained in:
Waylon S. Walker 2025-02-22 16:03:02 -06:00
commit f8b377c347
10 changed files with 1147 additions and 0 deletions

7
helm-chart/Chart.yaml Normal file
View file

@ -0,0 +1,7 @@
apiVersion: v2
icon: https://raw.githubusercontent.com/waylon/k8s-basic/master/helm-chart/logo.png
name: k8s-pages
description: A helm chart for basic container deployment
type: application
version: 1.0.0
appVersion: "1.0"

View file

@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
service: {{ .Values.name }}
name: {{ .Values.name }}
namespace: {{ .Values.namespace | default .Values.name }}
spec:
replicas: 1
selector:
matchLabels:
service: {{ .Values.name }}
template:
metadata:
labels:
service: {{ .Values.name }}
spec:
containers:
- image: {{ .Values.image.repository }}/{{ .Values.name }}:{{ .Values.image.tag }}
name: {{ .Values.name }}
ports:
- containerPort: {{ .Values.port }}
protocol: TCP
resources:
requests:
cpu: {{ .Values.cpuRequest }}
memory: {{ .Values.memoryRequest }}
limits:
cpu: {{ .Values.cpuLimit }}
memory: {{ .Values.memoryLimit }}
imagePullSecrets:
- name: {{ .Values.imagePullSecret }}

View file

@ -0,0 +1,25 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Values.name }}
namespace: {{ .Values.namespace | default .Values.name }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Values.name }}
minReplicas: {{ .Values.minReplicas }}
maxReplicas: {{ .Values.maxReplicas }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.targetCPUUtilization }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.targetMemoryUtilization }}

View file

@ -0,0 +1,26 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
labels:
service: {{ .Values.name }}
name: {{ .Values.name }}
namespace: {{ .Values.namespace }}
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
rules:
- host: {{ .Values.name }}.{{ .Values.domain }}
http:
paths:
- backend:
service:
name: {{ .Values.name }}
port:
number: {{ .Values.port }}
path: /
pathType: Prefix
tls:
- hosts:
- {{ .Values.name }}.{{ .Values.domain }}
secretName: {{ .Values.name }}-cert-tls

View file

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: {{ .Values.namespace | default .Values.name }}

View file

@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
labels:
service: {{ .Values.name }}
name: {{ .Values.name }}
namespace: {{ .Values.namespace | default .Values.name }}
spec:
ports:
- name: "{{ .Values.port }}"
port: {{ .Values.port }}
targetPort: {{ .Values.port }}
selector:
service: {{ .Values.name }}

17
helm-chart/values.yaml Normal file
View file

@ -0,0 +1,17 @@
name: opengraph
domain: wayl.one
port: 8000
image:
repository: registry.wayl.one
name: opengraph
tag: "0.0.1"
imageTag: 0.0.1
imagePullSecret: cluster-regcred
minReplicas: 1
maxReplicas: 3
targetCPUUtilization: 4000
cpuRequest: 10m
cpuLimit: 500m
memoryRequest: 100Mi
memoryLimit: 500Mi
targetMemoryUtilization: 400