Skip to content

Commit

Permalink
Restruct repository to support multiple charts
Browse files Browse the repository at this point in the history
  • Loading branch information
ileixe committed Apr 10, 2023
1 parent 32c687b commit 88d5e57
Show file tree
Hide file tree
Showing 27 changed files with 472 additions and 39 deletions.
6 changes: 0 additions & 6 deletions Chart.lock

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ Private helm chart
==================

# Available charts
- Kea-dhcp
- kea-dhcp
- pypi-server

# Getting started

Expand All @@ -11,4 +12,5 @@ helm repo add ileixe https://ileixe.github.io/charts/
helm repo update

helm install ileixe ileixe/kea-dhcp
helm install ileixe ileixe/pypi-server
```
55 changes: 25 additions & 30 deletions index.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,40 @@
apiVersion: v1
entries:
charts:
kea-dhcp:
- apiVersion: v2
appVersion: 1.16.0
created: "2021-11-30T18:28:56.839352159+09:00"
created: "2023-04-10T20:07:22.272774221+09:00"
dependencies:
- name: postgresql
repository: '@stable'
version: 6.3.12
description: A Helm chart for Kubernetes
digest: 578909edafe28926c9ec10754654fbf24f228611596689fb45b2dd648ffb7d8f
name: charts
description: A Helm chart for Kea DHCP
digest: 82be0dd32e5583e311a26e3920fe06328afd36f78faf0b637c790bca0560e9ad
name: kea-dhcp
type: application
urls:
- charts/charts-0.1.0.tgz
- kea-dhcp-0.1.0.tgz
version: 0.1.0
postgresql:
- apiVersion: v1
appVersion: 11.5.0
created: "2021-11-30T18:28:56.840781549+09:00"
description: Chart for PostgreSQL, an object-relational database management system
(ORDBMS) with an emphasis on extensibility and on standards-compliance.
digest: e3d8f710db745334731a5ed5d0a3b8731bb74109388e4755cc1ef6b9c4b2f288
home: https://www.postgresql.org/
icon: https://bitnami.com/assets/stacks/postgresql/img/postgresql-stack-110x117.png
pypi-server:
- apiVersion: v2
appVersion: 1.4.2
created: "2023-04-10T20:07:22.273213198+09:00"
description: A high availablility, persistent, auto-scaling pypi-server application.
digest: ae411f2af2053c29e280b555220be65e7af445232683976ea000c6c61db79044
home: https://github.com/cgsimmons/charts/tree/master/pypi-server
icon: https://cgsimmons.github.io/charts/icons/pypi-server.svg
keywords:
- postgresql
- postgres
- database
- sql
- replication
- cluster
- pypi
- python
maintainers:
- email: [email protected]
name: Bitnami
- email: [email protected]
name: desaintmartin
name: postgresql
- email: [email protected]
name: Youseok Yang
name: pypi-server
sources:
- https://github.com/bitnami/bitnami-docker-postgresql
- https://github.com/cgsimmons/charts/tree/master/pypi-server
- https://github.com/pypiserver/pypiserver
type: application
urls:
- charts/postgresql-6.3.12.tgz
version: 6.3.12
generated: "2021-11-30T18:28:56.837517065+09:00"
- pypi-server-0.2.0.tgz
version: 0.2.0
generated: "2023-04-10T20:07:22.269341764+09:00"
Binary file added kea-dhcp-0.1.0.tgz
Binary file not shown.
File renamed without changes.
4 changes: 2 additions & 2 deletions Chart.yaml → kea-dhcp/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: charts
description: A Helm chart for Kubernetes
name: kea-dhcp
description: A Helm chart for Kea DHCP
type: application
version: 0.1.0
appVersion: "1.16.0"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added pypi-server-0.2.0.tgz
Binary file not shown.
17 changes: 17 additions & 0 deletions pypi-server/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v2
name: pypi-server
version: 0.2.0
description: A high availablility, persistent, auto-scaling pypi-server application.
icon: https://cgsimmons.github.io/charts/icons/pypi-server.svg
type: application
keywords:
- pypi
- python
home: https://github.com/cgsimmons/charts/tree/master/pypi-server
sources:
- https://github.com/cgsimmons/charts/tree/master/pypi-server
- https://github.com/pypiserver/pypiserver
maintainers:
- name: Youseok Yang
email: [email protected]
appVersion: 1.4.2
3 changes: 3 additions & 0 deletions pypi-server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# PyPi Server Helm Chart

This chart is a fork from https://github.com/cgsimmons/charts/tree/master/pypi-server
12 changes: 12 additions & 0 deletions pypi-server/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
{{- end }}
{{- end }}
{{- else }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "pypiServer.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:8080
Verify server is running by visiting http://127.0.0.1:8080 in your browser or "curl 127.0.0.1:8080"
{{- end }}
63 changes: 63 additions & 0 deletions pypi-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "pypiServer.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 "pypiServer.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 "pypiServer.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

{{/*
Selector labels
*/}}
{{- define "pypiServer.selectorLabels" -}}
app.kubernetes.io/name: {{ include "pypiServer.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "pypiServer.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "pypiServer.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
28 changes: 28 additions & 0 deletions pypi-server/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "pypiServer.fullname" . }}
labels:
{{- include "pypiServer.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: StatefulSet
name: {{ include "pypiServer.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
41 changes: 41 additions & 0 deletions pypi-server/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "pypiServer.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "pypiServer.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
backend:
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
21 changes: 21 additions & 0 deletions pypi-server/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- if not .Values.persistence.existingClaim -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ include "pypiServer.fullname" . }}
labels:
{{- include "pypiServer.labels" . | nindent 4 }}
spec:
accessModes:
- "ReadWriteMany"
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{- if .Values.persistence.storageClassName }}
{{- if (eq "-" .Values.persistence.storageClassName) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.storageClassName }}"
{{- end }}
{{- end }}
{{- end -}}
16 changes: 16 additions & 0 deletions pypi-server/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if not .Values.auth.secretName -}}
{{- if ne .Values.auth.actions "." -}}
apiVersion: v1
kind: Secret
type: Opaque
stringData:
auth: |-
{{- range $key, $value := .Values.auth.credentials }}
{{ $key }}:{{ $value }}
{{- end }}
metadata:
name: {{ include "pypiServer.fullname" . }}
labels:
{{- include "pypiServer.labels" . | nindent 4 }}
{{- end -}}
{{- end -}}
15 changes: 15 additions & 0 deletions pypi-server/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "pypiServer.fullname" . }}
labels:
{{- include "pypiServer.labels" . | nindent 4 }}
spec:
type: ClusterIP
clusterIP: None
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector: {{- include "pypiServer.selectorLabels" . | nindent 4 }}
12 changes: 12 additions & 0 deletions pypi-server/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "pypiServer.serviceAccountName" . }}
labels:
{{- include "pypiServer.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
Loading

0 comments on commit 88d5e57

Please sign in to comment.