[stable/namerd] #1785 namespace defined templates with chart name (#2173)

This commit is contained in:
Kevin Schumacher
2017-10-05 11:40:17 +05:30
committed by Dhilip
parent baa81d878f
commit 597a371fca
6 changed files with 18 additions and 18 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
apiVersion: v1
description: Service that manages routing for multiple linkerd instances
name: namerd
version: 0.1.0
version: 0.2.0
home: https://linkerd.io/in-depth/namerd/
icon: https://pbs.twimg.com/profile_images/690258997237014528/KNgQd9GL_400x400.png
sources:
+4 -4
View File
@@ -1,15 +1,15 @@
1. Get the application URL by running these commands:
{{- if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }})
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "namerd.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT/login
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc -w {{ template "fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
You can watch the status of by running 'kubectl get svc -w {{ template "namerd.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "namerd.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.service.externalPort }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "namerd.fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:{{ .Values.service.externalPort }}
{{- end }}
+2 -2
View File
@@ -2,7 +2,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- define "namerd.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 "namerd.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
+2 -2
View File
@@ -2,11 +2,11 @@ apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: {{ template "fullname" . }}
app: {{ template "namerd.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: "{{ .Release.Service }}"
release: "{{ .Release.Name }}"
name: {{ template "fullname" . }}-config
name: {{ template "namerd.fullname" . }}-config
data:
config.yaml: |-
admin:
+7 -7
View File
@@ -1,9 +1,9 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "fullname" . }}
name: {{ template "namerd.fullname" . }}
labels:
app: {{ template "fullname" . }}
app: {{ template "namerd.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: "{{ .Release.Service }}"
release: "{{ .Release.Name }}"
@@ -12,14 +12,14 @@ spec:
template:
metadata:
labels:
app: {{ template "fullname" . }}
app: {{ template "namerd.fullname" . }}
spec:
volumes:
- name: {{ template "fullname" . }}-config
- name: {{ template "namerd.fullname" . }}-config
configMap:
name: "{{ template "fullname" . }}-config"
name: "{{ template "namerd.fullname" . }}-config"
containers:
- name: {{ template "fullname" . }}
- name: {{ template "namerd.fullname" . }}
image: "{{ .Values.namerd.image.repository }}"
imagePullPolicy: {{ default "" .Values.namerd.image.pullPolicy | quote }}
args:
@@ -30,7 +30,7 @@ spec:
- name: api
containerPort: {{ .Values.service.apiPort }}
volumeMounts:
- name: "{{ template "fullname" . }}-config"
- name: "{{ template "namerd.fullname" . }}-config"
mountPath: "/io.buoyant/namerd/config"
readOnly: true
resources:
+2 -2
View File
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "fullname" . }}
name: {{ template "namerd.fullname" . }}
labels:
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
spec:
@@ -14,4 +14,4 @@ spec:
- name: admin
port: {{ .Values.service.adminPort }}
selector:
app: {{ template "fullname" . }}
app: {{ template "namerd.fullname" . }}