Skip to content

Commit

Permalink
charts/cluster-warmer: Create chart (closes #101)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeemster committed Sep 1, 2023
1 parent 76c9cf4 commit e95ac5d
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 0 deletions.
14 changes: 14 additions & 0 deletions charts/cluster-warmer/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v2
name: cluster-warmer
description: A Helm Chart to deploy pods to force scaling in a node-pool to keep it warm
version: 0.1.0
icon: https://raw.githubusercontent.com/snowplow-devops/helm-charts/master/docs/logo/snowplow.png
home: https://github.com/snowplow-devops/helm-charts
sources:
- https://github.com/snowplow-devops/helm-charts
maintainers:
- name: jbeemster
url: https://github.com/jbeemster
email: [email protected]
keywords:
- cluster-autoscaler
32 changes: 32 additions & 0 deletions charts/cluster-warmer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# cluster-warmer

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square)

A Helm Chart to deploy pods to force scaling in a node-pool to keep it warm

**Homepage:** <https://github.com/snowplow-devops/helm-charts>

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| jbeemster | <[email protected]> | <https://github.com/jbeemster> |

## Source Code

* <https://github.com/snowplow-devops/helm-charts>

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| fullnameOverride | string | `""` | Overrides the full-name given to the deployment resources (default: .Release.Name) |
| hpa.replicas | int | `1` | Number of replicas to setup to manage how many warm nodes are created |
| image.isRepositoryPublic | bool | `true` | Whether the repository is public |
| image.pullPolicy | string | `"IfNotPresent"` | The image pullPolicy to use |
| image.repository | string | `"registry.k8s.io/pause"` | |
| image.tag | string | `"3.9"` | |
| resources | object | `{}` | Map of resource constraints for the warm pods (should be set to a sufficiently high number to trigger scaling) |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
13 changes: 13 additions & 0 deletions charts/cluster-warmer/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Create a default fully qualified app name.
We truncate at 50 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 "app.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 50 | trimSuffix "-" -}}
{{- else -}}
{{- .Release.Name | trunc 50 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
21 changes: 21 additions & 0 deletions charts/cluster-warmer/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "app.fullname" . }}
spec:
selector:
matchLabels:
app: {{ include "app.fullname" . }}
template:
metadata:
labels:
app: {{ include "app.fullname" . }}
spec:
priorityClassName: {{ include "app.fullname" . }}
terminationGracePeriodSeconds: 0
containers:
- name: "{{ include "app.fullname" . }}"
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ default "IfNotPresent" .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.resources | nindent 10 }}
12 changes: 12 additions & 0 deletions charts/cluster-warmer/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "app.fullname" . }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "app.fullname" . }}
minReplicas: {{ .Values.hpa.replicas }}
maxReplicas: {{ .Values.hpa.replicas }}
targetCPUUtilizationPercentage: 95
6 changes: 6 additions & 0 deletions charts/cluster-warmer/templates/priorityclass.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: {{ include "app.fullname" . }}
value: -1
globalDefault: false
19 changes: 19 additions & 0 deletions charts/cluster-warmer/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -- Overrides the full-name given to the deployment resources (default: .Release.Name)
fullnameOverride: ""

image:
repository: "registry.k8s.io/pause"
tag: "3.9"
# -- Whether the repository is public
isRepositoryPublic: true
# -- The image pullPolicy to use
pullPolicy: "IfNotPresent"

# -- Map of resource constraints for the warm pods (should be set to a sufficiently high number to trigger scaling)
resources: {}
# requests:
# cpu: 400m

hpa:
# -- Number of replicas to setup to manage how many warm nodes are created
replicas: 1

0 comments on commit e95ac5d

Please sign in to comment.