-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Kai Ren <tyranron@gmail.com>
- Loading branch information
Showing
14 changed files
with
581 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[*.tpl] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v2 | ||
name: baza | ||
version: 0.0.0-edge | ||
type: application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Baza can be accessed via these URLs inside your cluster: | ||
{{- if $.Values.nginx.enabled }} | ||
Nginx: http://{{ include "baza.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.nginx.port | int }}/ | ||
{{- end }} | ||
S3 API: http://{{ include "baza.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.conf.port | int }}/ | ||
|
||
{{- if .Values.ingress.enabled }}{{ "\n" }} | ||
Baza can be accessed via these URLs outside your cluster: | ||
{{- range .Values.ingress.hosts }} | ||
{{- if $.Values.nginx.enabled }} | ||
Nginx: http{{ if $.Values.ingress.tls.enabled }}s{{ end }}://{{ . }}{{ $.Values.ingress.subPath | trimSuffix "/" }}/ | ||
{{- end }} | ||
S3 API: http{{ if $.Values.ingress.tls.enabled }}s{{ end }}://{{ . }}{{ $.Values.ingress.subPath | trimSuffix "/" }}/s3/ | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "baza.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 55 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 55 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 "baza.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 55 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 55 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 55 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "baza.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 55 | trimSuffix "-" -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{{- if .Values.nginx.enabled }} | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: {{ printf "%s.nginx.conf" (include "baza.fullname" .) | quote }} | ||
namespace: {{ .Release.Namespace | quote }} | ||
labels: | ||
helm.sh/chart: {{ include "baza.chart" . | quote }} | ||
app.kubernetes.io/name: {{ include "baza.name" . | quote }} | ||
app.kubernetes.io/instance: {{ .Release.Name | quote }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service | quote }} | ||
{{- with .Values.labels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
data: | ||
{{- with .Values.nginx.conf }} | ||
nginx.conf: | | ||
{{- . | nindent 4 }} | ||
{{- end }} | ||
{{- if index .Values.nginx "conf.d" }} | ||
{{- range $file := slice (keys (index .Values.nginx "conf.d") | sortAlpha) }} | ||
{{- with index $.Values.nginx "conf.d" $file }} | ||
{{ printf "conf.d__%s" $file | quote }}: | | ||
{{- . | nindent 4 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{{- if .Values.ingress.enabled }} | ||
{{- range $host := .Values.ingress.hosts }} | ||
--- | ||
kind: Ingress | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
name: {{ printf "%s.%s" (include "baza.fullname" $) $host | quote }} | ||
namespace: {{ $.Release.Namespace | quote }} | ||
labels: | ||
helm.sh/chart: {{ include "baza.chart" $ | quote }} | ||
app.kubernetes.io/name: {{ include "baza.name" $ | quote }} | ||
app.kubernetes.io/instance: {{ $.Release.Name | quote }} | ||
app.kubernetes.io/managed-by: {{ $.Release.Service | quote }} | ||
{{- with $.Values.labels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
annotations: | ||
{{- if and $.Values.ingress.tls.enabled $.Values.ingress.tls.auto }} | ||
kubernetes.io/tls-acme: "true" | ||
{{- end }} | ||
{{- if not $.Values.ingress.tls.enabled }} | ||
nginx.ingress.kubernetes.io/ssl-redirect: "false" | ||
{{- end }} | ||
nginx.ingress.kubernetes.io/rewrite-target: /$1 | ||
{{- with $.Values.ingress.annotations }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
rules: | ||
{{- range $h := list $host (printf "www.%s" $host) }} | ||
- host: {{ $h | quote }} | ||
http: | ||
paths: | ||
- path: {{ $.Values.ingress.subPath | trimSuffix "/" }}/s3/(.*) | ||
pathType: ImplementationSpecific | ||
backend: | ||
service: | ||
name: {{ include "baza.fullname" $ | quote }} | ||
port: | ||
name: s3 | ||
{{- if $.Values.nginx.enabled }} | ||
- path: {{ $.Values.ingress.subPath | trimSuffix "/" }}/(.*) | ||
pathType: ImplementationSpecific | ||
backend: | ||
service: | ||
name: {{ include "baza.fullname" $ | quote }} | ||
port: | ||
name: http | ||
{{- end }} | ||
{{- end }} | ||
{{- if $.Values.ingress.tls.enabled }} | ||
tls: | ||
- secretName: {{ if $.Values.ingress.tls.auto -}} | ||
{{ printf "%s.tls" ($host | trunc 48 | trimSuffix ".") | quote }} | ||
{{- else -}} | ||
{{ required (print `TLS Secret name must be specified for host ` $host ` !`) (index $.Values.ingress.tls.secretName $host) | quote }} | ||
{{- end }} | ||
hosts: | ||
- {{ $host | quote }} | ||
- {{ printf "www.%s" $host | quote }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{{- if .Values.data.persistentVolume.enabled }} | ||
{{- if not .Values.data.persistentVolume.existingClaim }} | ||
kind: PersistentVolumeClaim | ||
apiVersion: v1 | ||
metadata: | ||
name: {{ include "baza.fullname" . | quote }} | ||
namespace: {{ .Release.Namespace | quote }} | ||
labels: | ||
helm.sh/chart: {{ include "baza.chart" . | quote }} | ||
app.kubernetes.io/name: {{ include "baza.name" . | quote }} | ||
app.kubernetes.io/instance: {{ .Release.Name | quote }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service | quote }} | ||
{{- with .Values.data.persistentVolume.annotations }} | ||
annotations: {{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
accessModes: {{- toYaml .Values.data.persistentVolume.accessModes | nindent 4 }} | ||
{{- if .Values.data.persistentVolume.storageClass }} | ||
{{- if (eq "-" .Values.data.persistentVolume.storageClass) }} | ||
storageClassName: "" | ||
{{- else }} | ||
storageClassName: {{ .Values.data.persistentVolume.storageClass | quote }} | ||
{{- end }} | ||
{{- end }} | ||
resources: | ||
requests: | ||
storage: {{ .Values.data.persistentVolume.size | quote }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: {{ include "baza.fullname" . | quote }} | ||
namespace: {{ .Release.Namespace | quote }} | ||
labels: | ||
helm.sh/chart: {{ include "baza.chart" . | quote }} | ||
app.kubernetes.io/name: {{ include "baza.name" . | quote }} | ||
app.kubernetes.io/instance: {{ .Release.Name | quote }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service | quote }} | ||
{{- with .Values.labels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
type: ClusterIP | ||
clusterIP: None | ||
selector: | ||
app.kubernetes.io/name: {{ include "baza.name" . | quote }} | ||
app.kubernetes.io/instance: {{ .Release.Name | quote }} | ||
ports: | ||
{{- if .Values.nginx.enabled }} | ||
- name: http | ||
port: {{ .Values.nginx.port | int }} | ||
targetPort: http | ||
protocol: TCP | ||
{{- end }} | ||
- name: s3 | ||
port: {{ .Values.conf.port | int }} | ||
targetPort: s3 | ||
protocol: TCP | ||
|
||
{{- range $n := until (.Values.statefulset.replicas | int) }} | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: {{ printf "%s-%d" (include "baza.fullname" $) $n | quote }} | ||
namespace: {{ $.Release.Namespace | quote }} | ||
labels: | ||
helm.sh/chart: {{ include "baza.chart" $ | quote }} | ||
app.kubernetes.io/name: {{ include "baza.name" $ | quote }} | ||
app.kubernetes.io/instance: {{ $.Release.Name | quote }} | ||
app.kubernetes.io/managed-by: {{ $.Release.Service | quote }} | ||
{{- with $.Values.labels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
app.kubernetes.io/name: {{ include "baza.name" $ | quote }} | ||
app.kubernetes.io/instance: {{ $.Release.Name | quote }} | ||
statefulset.kubernetes.io/pod-name: {{ printf "%s-%d" (include "baza.fullname" $) $n | quote }} | ||
ports: | ||
{{- if $.Values.nginx.enabled }} | ||
- name: http | ||
port: {{ $.Values.nginx.port | int }} | ||
targetPort: http | ||
protocol: TCP | ||
{{- end }} | ||
- name: s3 | ||
port: {{ $.Values.conf.port | int }} | ||
targetPort: s3 | ||
protocol: TCP | ||
{{- end }} |
Oops, something went wrong.