Skip to content

Instantly share code, notes, and snippets.

@harsh-98
Created April 8, 2019 08:09
Show Gist options
  • Save harsh-98/5d8e63063879cce6d1a44105d2514124 to your computer and use it in GitHub Desktop.
Save harsh-98/5d8e63063879cce6d1a44105d2514124 to your computer and use it in GitHub Desktop.
Output of ` tiller.install_release(chart.get_helm_chart(), dry_run=True, namespace='default')`
>>> tiller.install_release(chart.get_helm_chart(), dry_run=True, namespace='default')
release {
name: "rafting-possum"
info {
status {
code: PENDING_INSTALL
notes: "1. Get the application URL by running these commands:\n export POD_NAME=$(kubectl get pods --namespace default -l \"app.kubernetes.io/name=mychart,app.kubernetes.io/instance=rafting-possum\" -o jsonpath=\"{.items[0].metadata.name}\")\n echo \"Visit http://127.0.0.1:8080 to use your application\"\n kubectl port-forward $POD_NAME 8080:80\n"
}
first_deployed {
seconds: 1554710849
nanos: 296740286
}
last_deployed {
seconds: 1554710849
nanos: 296740286
}
Description: "Dry run complete"
}
chart {
metadata {
name: "mychart"
version: "0.1.0"
description: "A Helm chart for Kubernetes"
}
templates {
name: "templates/_helpers.tpl"
data: "{{/* vim: set filetype=mustache: */}}\n{{/*\nExpand the name of the chart.\n*/}}\n{{- define \"mychart.name\" -}}\n{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix \"-\" -}}\n{{- end -}}\n\n{{/*\nCreate a default fully qualified app name.\nWe truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).\nIf release name contains chart name it will be used as a full name.\n*/}}\n{{- define \"mychart.fullname\" -}}\n{{- if .Values.fullnameOverride -}}\n{{- .Values.fullnameOverride | trunc 63 | trimSuffix \"-\" -}}\n{{- else -}}\n{{- $name := default .Chart.Name .Values.nameOverride -}}\n{{- if contains $name .Release.Name -}}\n{{- .Release.Name | trunc 63 | trimSuffix \"-\" -}}\n{{- else -}}\n{{- printf \"%s-%s\" .Release.Name $name | trunc 63 | trimSuffix \"-\" -}}\n{{- end -}}\n{{- end -}}\n{{- end -}}\n\n{{/*\nCreate chart name and version as used by the chart label.\n*/}}\n{{- define \"mychart.chart\" -}}\n{{- printf \"%s-%s\" .Chart.Name .Chart.Version | replace \"+\" \"_\" | trunc 63 | trimSuffix \"-\" -}}\n{{- end -}}\n"
}
templates {
name: "templates/service.yaml"
data: "apiVersion: v1\nkind: Service\nmetadata:\n name: {{ include \"mychart.fullname\" . }}\n labels:\n app.kubernetes.io/name: {{ include \"mychart.name\" . }}\n helm.sh/chart: {{ include \"mychart.chart\" . }}\n app.kubernetes.io/instance: {{ .Release.Name }}\n app.kubernetes.io/managed-by: {{ .Release.Service }}\nspec:\n type: {{ .Values.service.type }}\n ports:\n - port: {{ .Values.service.port }}\n targetPort:
http\n protocol: TCP\n name: http\n selector:\n app.kubernetes.io/name: {{ include \"mychart.name\" . }}\n app.kubernetes.io/instance: {{ .Release.Name }}\n"
}
templates {
name: "templates/deployment.yaml"
data: "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: {{ include \"mychart.fullname\" . }}\n labels:\n app.kubernetes.io/name: {{ include \"mychart.name\" . }}\n helm.sh/chart: {{ include \"mychart.chart\" . }}\n app.kubernetes.io/instance: {{ .Release.Name }}\n app.kubernetes.io/managed-by: {{ .Release.Service }}\nspec:\n replicas: {{ .Values.replicaCount }}\n selector:\n matchLabels:\n app.kubernetes.io/name: {{ include \"mychart.name\" . }}\n app.kubernetes.io/instance: {{ .Release.Name }}\n template:\n metadata:\n labels:\n app.kubernetes.io/name: {{ include \"mychart.name\" . }}\n app.kubernetes.io/instance: {{ .Release.Name }}\n spec:\n containers:\n - name: {{ .Chart.Name }}\n image: \"{{ .Values.image.repository }}:{{ .Values.image.tag }}\"\n imagePullPolicy: {{ .Values.image.pullPolicy }}\n ports:\n - name: http\n containerPort: 80\n protocol: TCP\n livenessProbe:\n httpGet:\n path: /\n port: http\n readinessProbe:\n httpGet:\n path: /\n port: http\n resources:\n {{- toYaml .Values.resources | nindent 12 }}\n {{- with .Values.nodeSelector }}\n nodeSelector:\n {{- toYaml . | nindent 8 }}\n {{- end }}\n {{- with .Values.affinity }}\n affinity:\n {{- toYaml . | nindent 8 }}\n {{- end }}\n {{- with .Values.tolerations }}\n tolerations:\n {{- toYaml . | nindent 8 }}\n {{- end }}\n"
}
templates {
name: "templates/NOTES.txt"
data: "1. Get the application URL by running these commands:\n{{- if .Values.ingress.enabled }}\n{{- range $host := .Values.ingress.hosts }}\n {{- range .paths }}\n http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}\n {{- end }}\n{{- end }}\n{{- else if contains \"NodePort\" .Values.service.type }}\n export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath=\"{.spec.ports[0].nodePort}\" services
{{ include \"mychart.fullname\" . }})\n export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath=\"{.items[0].status.addresses[0].address}\")\n echo http://$NODE_IP:$NODE_PORT\n{{- else if contains \"LoadBalancer\" .Values.service.type }}\n NOTE: It may take a few minutes for the LoadBalancer IP to be available.\n You can watch the status of by running \'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include \"mychart.fullname\" . }}\'\n export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include \"mychart.fullname\" . }} -o jsonpath=\'{.status.loadBalancer.ingress[0].ip}\')\n echo http://$SERVICE_IP:{{ .Values.service.port }}\n{{- else if contains \"ClusterIP\" .Values.service.type }}\n export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l \"app.kubernetes.io/name={{ include \"mychart.name\" . }},app.kubernetes.io/instance={{ .Release.Name }}\" -o jsonpath=\"{.items[0].metadata.name}\")\n echo \"Visit http://127.0.0.1:8080 to use your application\"\n kubectl port-forward $POD_NAME 8080:80\n{{- end }}\n"
}
templates {
name: "templates/ingress.yaml"
data: "{{- if .Values.ingress.enabled -}}\n{{- $fullName := include \"mychart.fullname\" . -}}\napiVersion: extensions/v1beta1\nkind: Ingress\nmetadata:\n name: {{ $fullName }}\n labels:\n app.kubernetes.io/name: {{ include \"mychart.name\" . }}\n helm.sh/chart: {{ include \"mychart.chart\" . }}\n app.kubernetes.io/instance: {{ .Release.Name }}\n app.kubernetes.io/managed-by: {{ .Release.Service }}\n {{- with .Values.ingress.annotations }}\n annotations:\n {{- toYaml . | nindent 4 }}\n {{- end }}\nspec:\n{{- if .Values.ingress.tls }}\n tls:\n {{- range .Values.ingress.tls }}\n - hosts:\n {{- range .hosts }}\n - {{ . | quote }}\n {{- end }}\n secretName: {{ .secretName }}\n {{- end }}\n{{- end }}\n rules:\n {{- range .Values.ingress.hosts }}\n - host: {{ .host | quote }}\n http:\n paths:\n {{- range .paths }}\n
- path: {{ . }}\n backend:\n serviceName: {{ $fullName }}\n servicePort: http\n {{- end }}\n {{- end }}\n{{- end }}\n"
}
templates {
name: "templates/tests/test-connection.yaml"
data: "apiVersion: v1\nkind: Pod\nmetadata:\n name: \"{{ include \"mychart.fullname\" . }}-test-connection\"\n labels:\n app.kubernetes.io/name: {{ include \"mychart.name\" . }}\n helm.sh/chart: {{ include \"mychart.chart\" . }}\n app.kubernetes.io/instance: {{ .Release.Name }}\n app.kubernetes.io/managed-by: {{ .Release.Service }}\n annotations:\n \"helm.sh/hook\": test-success\nspec:\n containers:\n - name: wget\n
image: busybox\n command: [\'wget\']\n args: [\'{{ include \"mychart.fullname\" . }}:{{ .Values.service.port }}\']\n restartPolicy: Never\n"
}
values {
raw: "# Default values for mychart.\n# This is a YAML-formatted file.\n# Declare variables to be passed into your templates.\n\nreplicaCount: 1\n\nimage:\n repository: nginx\n tag: stable\n pullPolicy: IfNotPresent\n\nnameOverride: \"\"\nfullnameOverride: \"\"\n\nservice:\n type: ClusterIP\n port: 80\n\ningress:\n enabled: false\n annotations: {}\n # kubernetes.io/ingress.class: nginx\n # kubernetes.io/tls-acme: \"true\"\n hosts:\n - host: chart-example.local\n paths: []\n\n tls: []\n # - secretName: chart-example-tls\n # hosts:\n # - chart-example.local\n\nresources: {}\n # We usually recommend not to specify default resources and to leave this as a conscious\n # choice for the user. This also increases chances charts run on environments with little\n # resources, such as Minikube. If you do want to specify resources, uncomment the following\n # lines, adjust them as necessary, and remove the curly braces after \'resources:\'.\n # limits:\n # cpu: 100m\n # memory: 128Mi\n # requests:\n # cpu: 100m\n # memory: 128Mi\n\nnodeSelector: {}\n\ntolerations: []\n\naffinity: {}\n"
}
files {
type_url: "templates/tests/test-connection.yaml"
value: "apiVersion: v1\nkind: Pod\nmetadata:\n name: \"{{ include \"mychart.fullname\" . }}-test-connection\"\n labels:\n app.kubernetes.io/name: {{ include \"mychart.name\" . }}\n helm.sh/chart: {{ include \"mychart.chart\" . }}\n app.kubernetes.io/instance: {{ .Release.Name }}\n app.kubernetes.io/managed-by: {{ .Release.Service }}\n annotations:\n \"helm.sh/hook\": test-success\nspec:\n containers:\n - name: wget\n
image: busybox\n command: [\'wget\']\n args: [\'{{ include \"mychart.fullname\" . }}:{{ .Values.service.port }}\']\n restartPolicy: Never\n"
}
}
config {
raw: "{}\n"
}
manifest: "\n---\n# Source: mychart/templates/service.yaml\napiVersion: v1\nkind: Service\nmetadata:\n name: rafting-possum-mychart\n labels:\n app.kubernetes.io/name: mychart\n helm.sh/chart: mychart-0.1.0\n app.kubernetes.io/instance: rafting-possum\n app.kubernetes.io/managed-by: Tiller\nspec:\n type: ClusterIP\n ports:\n - port: 80\n targetPort: http\n protocol: TCP\n name: http\n selector:\n app.kubernetes.io/name: mychart\n app.kubernetes.io/instance: rafting-possum\n---\n# Source: mychart/templates/deployment.yaml\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: rafting-possum-mychart\n labels:\n app.kubernetes.io/name: mychart\n helm.sh/chart: mychart-0.1.0\n app.kubernetes.io/instance: rafting-possum\n app.kubernetes.io/managed-by: Tiller\nspec:\n replicas: 1\n selector:\n matchLabels:\n app.kubernetes.io/name: mychart\n app.kubernetes.io/instance: rafting-possum\n template:\n metadata:\n labels:\n app.kubernetes.io/name: mychart\n app.kubernetes.io/instance: rafting-possum\n spec:\n containers:\n - name: mychart\n image: \"nginx:stable\"\n imagePullPolicy: IfNotPresent\n ports:\n - name: http\n containerPort: 80\n protocol: TCP\n
livenessProbe:\n httpGet:\n path: /\n port: http\n readinessProbe:\n httpGet:\n path: /\n port: http\n resources:\n {}"
hooks {
name: "rafting-possum-mychart-test-connection"
kind: "Pod"
path: "mychart/templates/tests/test-connection.yaml"
manifest: "apiVersion: v1\nkind: Pod\nmetadata:\n name: \"rafting-possum-mychart-test-connection\"\n labels:\n app.kubernetes.io/name: mychart\n helm.sh/chart: mychart-0.1.0\n app.kubernetes.io/instance: rafting-possum\n app.kubernetes.io/managed-by: Tiller\n annotations:\n \"helm.sh/hook\": test-success\nspec:\n containers:\n - name: wget\n image: busybox\n command: [\'wget\']\n args: [\'rafting-possum-mychart:80\']\n restartPolicy: Never"
events: RELEASE_TEST_SUCCESS
}
version: 1
namespace: "default"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment