Skip to content

Commit

Permalink
chore: change chart for new application
Browse files Browse the repository at this point in the history
  • Loading branch information
portswigger-tim committed Sep 27, 2022
1 parent 16c4f7a commit 9e958e2
Show file tree
Hide file tree
Showing 8 changed files with 294 additions and 0 deletions.
23 changes: 23 additions & 0 deletions helm-charts/json-api-proxy/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
41 changes: 41 additions & 0 deletions helm-charts/json-api-proxy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: v2
name: json-api-proxy
description: A Helm chart for the JSON API Proxies

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
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.0.1

# 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
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 0.0.1

keywords:
- proxy
- grafana
- JSON
- API

home: https://github.com/devopsmakers/grafana-json-api-proxies/tree/main/helm-charts/json-api-proxy

sources:
- https://github.com/devopsmakers/grafana-json-api-proxies/

maintainers:
- name: Tim Birkett

annotations:
artifacthub.io/changes: |
- version 0.0.1
39 changes: 39 additions & 0 deletions helm-charts/json-api-proxy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# json-api-proxy

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

A Helm chart for the JSON API Proxies

**Homepage:** <https://github.com/devopsmakers/grafana-json-api-proxies/tree/main/helm-charts/json-api-proxy>

## Installation
```
helm repo add grafana-json-apis-proxies https://devopsmakers.github.io/grafana-json-apis-proxies
helm install json-api-proxy grafana-json-api-proxies/json-api-proxy
```

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| Tim Birkett | | |

## Source Code

* <https://github.com/devopsmakers/grafana-json-api-proxies/>

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| env | list | `[]` | |
| fullnameOverride | string | `"ical-proxy"` | |
| image.repository | string | `"ghcr.io/devopsmakers/ical-proxy"` | |
| image.tag | string | `""` | |
| imagePullSecrets | list | `[]` | |
| nameOverride | string | `"ical-proxy"` | |
| nodeSelector | object | `{}` | |
| replicaCount | int | `1` | |
| resources | object | `{}` | |
| tolerations | list | `[]` | |
22 changes: 22 additions & 0 deletions helm-charts/json-api-proxy/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{ template "chart.header" . }}
{{ template "chart.deprecationWarning" . }}

{{ template "chart.badgesSection" . }}

{{ template "chart.description" . }}

{{ template "chart.homepageLine" . }}

## Installation
```
helm repo add grafana-json-apis-proxies https://devopsmakers.github.io/grafana-json-apis-proxies
helm install {{ template "chart.name" . }} grafana-json-api-proxies/{{ template "chart.name" . }}
```

{{ template "chart.maintainersSection" . }}

{{ template "chart.sourcesSection" . }}

{{ template "chart.requirementsSection" . }}

{{ template "chart.valuesSection" . }}
51 changes: 51 additions & 0 deletions helm-charts/json-api-proxy/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "json-api-proxy.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 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 "json-api-proxy.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "json-api-proxy.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "json-api-proxy.labels" -}}
helm.sh/chart: {{ include "json-api-proxy.chart" . }}
{{ include "json-api-proxy.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "json-api-proxy.selectorLabels" -}}
app.kubernetes.io/name: {{ include "json-api-proxy.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
69 changes: 69 additions & 0 deletions helm-charts/json-api-proxy/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "json-api-proxy.fullname" . }}
labels:
{{- include "json-api-proxy.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "json-api-proxy.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "json-api-proxy.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
automountServiceAccountToken: false
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1337
capabilities:
drop:
- ALL
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: Always
ports:
- name: http
containerPort: 5000
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
periodSeconds: 10
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /
port: http
periodSeconds: 10
timeoutSeconds: 5
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.env }}
env:
{{- toYaml . | nindent 12 }}
{{- 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 }}
13 changes: 13 additions & 0 deletions helm-charts/json-api-proxy/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "json-api-proxy.fullname" . }}
spec:
type: ClusterIP
selector:
{{- include "json-api-proxy.selectorLabels" . | nindent 4 }}
ports:
- name: http
protocol: TCP
port: 5000
targetPort: 5000
36 changes: 36 additions & 0 deletions helm-charts/json-api-proxy/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Default values for json-api-proxy
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

image:
repository: ghcr.io/devopsmakers/ical-proxy
# Overrides the image tag whose default is the chart appVersion.
tag: ""

imagePullSecrets: []
nameOverride: "ical-proxy"
fullnameOverride: "ical-proxy"

resources: {}
# 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
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

nodeSelector: {}

tolerations: []

affinity: {}

env: []
# - name: CACHE_TTL
# value: "300"

0 comments on commit 9e958e2

Please sign in to comment.