[stable/minio] #1785 namespace defined templates with chart name (#2177)

This commit is contained in:
Kevin Schumacher
2017-10-05 11:19:27 +05:30
committed by Dhilip
parent 96debc70a4
commit 66ce5f508a
9 changed files with 48 additions and 48 deletions
+8 -8
View File
@@ -1,10 +1,10 @@
{{- if eq .Values.serviceType "ClusterIP" }}
Minio can be accessed via port {{ .Values.servicePort }} on the following DNS name from within your cluster:
{{ template "fullname" . }}-svc.{{ .Release.Namespace }}.svc.cluster.local
{{ template "minio.fullname" . }}-svc.{{ .Release.Namespace }}.svc.cluster.local
To access Minio from localhost, run the below commands:
1. export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
1. export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "minio.fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
2. kubectl port-forward $POD_NAME 9000 --namespace {{ .Release.Namespace }}
@@ -14,15 +14,15 @@ You can now access Minio server on http://localhost:9000. Follow the below steps
1. Download the Minio mc client - https://docs.minio.io/docs/minio-client-quickstart-guide
2. mc config host add {{ template "fullname" . }}-local http://localhost:9000 {{ .Values.accessKey }} {{ .Values.secretKey }} S3v4
2. mc config host add {{ template "minio.fullname" . }}-local http://localhost:9000 {{ .Values.accessKey }} {{ .Values.secretKey }} S3v4
3. mc ls {{ template "fullname" . }}-local
3. mc ls {{ template "minio.fullname" . }}-local
Alternately, you can use your browser or the Minio SDK to access the server - https://docs.minio.io/categories/17
{{- end }}
{{- if eq .Values.serviceType "LoadBalancer" }}
Minio can be accessed via port {{ .Values.servicePort }} on an external IP address. Get the service external IP address by:
kubectl get svc --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }}
kubectl get svc --namespace {{ .Release.Namespace }} -l app={{ template "minio.fullname" . }}
Note that the public IP may take a couple of minutes to be available.
@@ -30,15 +30,15 @@ You can now access Minio server on http://<External-IP>:9000. Follow the below s
1. Download the Minio mc client - https://docs.minio.io/docs/minio-client-quickstart-guide
2. mc config host add {{ template "fullname" . }}-local http://<External-IP>:{{ .Values.servicePort }} {{ .Values.accessKey }} {{ .Values.secretKey }} S3v4
2. mc config host add {{ template "minio.fullname" . }}-local http://<External-IP>:{{ .Values.servicePort }} {{ .Values.accessKey }} {{ .Values.secretKey }} S3v4
3. mc ls {{ template "fullname" . }}-local
3. mc ls {{ template "minio.fullname" . }}-local
Alternately, you can use your browser or the Minio SDK to access the server - https://docs.minio.io/categories/17
{{- end }}
{{ if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }}
Note: Since NetworkPolicy is enabled, only pods with label
{{ template "fullname" . }}-client=true"
{{ template "minio.fullname" . }}-client=true"
will be able to connect to this minio cluster.
{{- end }}
+3 -3
View File
@@ -2,7 +2,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- define "minio.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
@@ -10,7 +10,7 @@ Expand the name of the chart.
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).
*/}}
{{- define "fullname" -}}
{{- define "minio.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
@@ -18,7 +18,7 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{/*
Return the appropriate apiVersion for networkpolicy.
*/}}
{{- define "networkPolicy.apiVersion" -}}
{{- define "minio.networkPolicy.apiVersion" -}}
{{- if and (ge .Capabilities.KubeVersion.Minor "4") (le .Capabilities.KubeVersion.Minor "6") -}}
{{- print "extensions/v1beta1" -}}
{{- else if ge .Capabilities.KubeVersion.Minor "7" -}}
+10 -10
View File
@@ -2,9 +2,9 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "fullname" . }}
name: {{ template "minio.fullname" . }}
labels:
app: {{ template "fullname" . }}
app: {{ template "minio.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
@@ -14,12 +14,12 @@ spec:
{{- end }}
selector:
matchLabels:
app: {{ template "fullname" . }}
app: {{ template "minio.fullname" . }}
template:
metadata:
name: {{ template "fullname" . }}
name: {{ template "minio.fullname" . }}
labels:
app: {{ template "fullname" . }}
app: {{ template "minio.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
@@ -34,16 +34,16 @@ spec:
- name: export
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ template "fullname" . }}
claimName: {{ template "minio.fullname" . }}
{{- else }}
emptyDir: {}
{{- end }}
- name: minio-server-config
configMap:
name: {{ template "fullname" . }}-config-cm
name: {{ template "minio.fullname" . }}-config-cm
- name: minio-user
secret:
secretName: {{ template "fullname" . }}-user
secretName: {{ template "minio.fullname" . }}-user
containers:
- name: minio
image: {{ .Values.image }}:{{ .Values.imageTag }}
@@ -68,12 +68,12 @@ spec:
- name: MINIO_ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}-user
name: {{ template "minio.fullname" . }}-user
key: accesskey
- name: MINIO_SECRET_KEY
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}-user
name: {{ template "minio.fullname" . }}-user
key: secretkey
livenessProbe:
tcpSocket:
@@ -1,17 +1,17 @@
{{- if .Values.networkPolicy.enabled }}
kind: NetworkPolicy
apiVersion: {{ template "networkPolicy.apiVersion" . }}
apiVersion: {{ template "minio.networkPolicy.apiVersion" . }}
metadata:
name: {{ template "fullname" . }}
name: {{ template "minio.fullname" . }}
labels:
app: {{ template "fullname" . }}
app: {{ template "minio.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
podSelector:
matchLabels:
app: {{ template "fullname" . }}
app: {{ template "minio.fullname" . }}
ingress:
- ports:
- port: {{ .Values.servicePort }}
@@ -19,6 +19,6 @@ spec:
from:
- podSelector:
matchLabels:
{{ template "fullname" . }}-client: "true"
{{ template "minio.fullname" . }}-client: "true"
{{- end }}
{{- end }}
+1 -1
View File
@@ -3,7 +3,7 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "fullname" . }}
name: {{ template "minio.fullname" . }}
spec:
accessModes:
{{- if eq .Values.mode "shared" }}
+2 -2
View File
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ template "fullname" . }}-user
name: {{ template "minio.fullname" . }}-user
labels:
app: {{ template "fullname" . }}
app: {{ template "minio.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
+14 -14
View File
@@ -3,9 +3,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "fullname" . }}
name: {{ template "minio.fullname" . }}
labels:
app: {{ template "fullname" . }}
app: {{ template "minio.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
@@ -17,28 +17,28 @@ spec:
targetPort: {{ .Values.servicePort }}
protocol: TCP
selector:
app: {{ template "fullname" . }}
app: {{ template "minio.fullname" . }}
---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: {{ template "fullname" . }}
name: {{ template "minio.fullname" . }}
labels:
app: {{ template "fullname" . }}
app: {{ template "minio.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
serviceName: {{ template "fullname" . }}
serviceName: {{ template "minio.fullname" . }}
replicas: {{ .Values.replicas }}
selector:
matchLabels:
app: {{ template "fullname" . }}
app: {{ template "minio.fullname" . }}
template:
metadata:
name: {{ template "fullname" . }}
name: {{ template "minio.fullname" . }}
labels:
app: {{ template "fullname" . }}
app: {{ template "minio.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
@@ -46,10 +46,10 @@ spec:
volumes:
- name: minio-user
secret:
secretName: {{ template "fullname" . }}-user
secretName: {{ template "minio.fullname" . }}-user
- name: minio-server-config
configMap:
name: {{ template "fullname" . }}-config-cm
name: {{ template "minio.fullname" . }}-config-cm
- name: podinfo
downwardAPI:
items:
@@ -67,7 +67,7 @@ spec:
args:
- server
{{- range $i := until $nodeCount }}
- http://{{ template "fullname" $ }}-{{ $i }}.{{ template "fullname" $ }}.{{ $.Release.Namespace }}.svc.cluster.local{{ $.Values.mountPath }}
- http://{{ template "minio.fullname" $ }}-{{ $i }}.{{ template "minio.fullname" $ }}.{{ $.Release.Namespace }}.svc.cluster.local{{ $.Values.mountPath }}
{{- end }}
{{- end }}
volumeMounts:
@@ -85,12 +85,12 @@ spec:
- name: MINIO_ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}-user
name: {{ template "minio.fullname" . }}-user
key: accesskey
- name: MINIO_SECRET_KEY
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}-user
name: {{ template "minio.fullname" . }}-user
key: secretkey
resources:
{{ toYaml .Values.resources | indent 12 }}
+3 -3
View File
@@ -1,9 +1,9 @@
kind: Service
apiVersion: v1
metadata:
name: {{ template "fullname" . }}-svc
name: {{ template "minio.fullname" . }}-svc
labels:
app: {{ template "fullname" . }}
app: {{ template "minio.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
@@ -13,7 +13,7 @@ spec:
loadBalancerIP: {{ default "" .Values.minioLoadBalancerIP }}
{{- end }}
selector:
app: {{ template "fullname" . }}
app: {{ template "minio.fullname" . }}
ports:
- name: service
port: 9000
@@ -1,9 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "fullname" . }}-config-cm
name: {{ template "minio.fullname" . }}-config-cm
labels:
app: {{ template "fullname" . }}
app: {{ template "minio.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"