github.com/replicatedhq/ship@v0.55.0/integration/base/helm-nginx/input/.ship/ship.yml (about) 1 # nginx helm chart rendering example, using k8s.io/helm/docs/examples/nginx 2 --- 3 assets: 4 v1: 5 - inline: 6 dest: "scripts/test.sh" 7 contents: "#/bin/bash" 8 - inline: 9 dest: "scripts/install.sh" 10 contents: "#/bin/bash" 11 - inline: 12 dest: charts/src/nginx/Chart.yaml 13 contents: | 14 name: nginx 15 description: A basic NGINX HTTP server 16 version: 0.1.0 17 kubeVersion: ">=1.2.0" 18 keywords: 19 - http 20 - nginx 21 - www 22 - web 23 home: https://github.com/kubernetes/helm 24 sources: 25 - https://hub.docker.com/_/nginx/ 26 maintainers: 27 - name: technosophos 28 email: mbutcher@deis.com 29 - inline: 30 dest: charts/src/nginx/templates/configmap.yaml 31 contents: | 32 # This is a simple example of using a config map to create a single page static site. 33 apiVersion: v1 34 kind: ConfigMap 35 metadata: 36 name: {{ template "nginx.fullname" . }} 37 labels: 38 heritage: {{ .Release.Service }} 39 release: {{ .Release.Name }} 40 chart: {{ .Chart.Name }}-{{ .Chart.Version }} 41 app: {{ template "nginx.name" . }} 42 data: 43 # When the config map is mounted as a volume, these will be created as files. 44 index.html: {{ .Values.index | quote }} 45 test.txt: test 46 47 - inline: 48 dest: charts/src/nginx/templates/deployment.yaml 49 contents: | 50 apiVersion: extensions/v1beta1 51 kind: Deployment 52 metadata: 53 # This uses a "fullname" template (see _helpers) 54 # Basing names on .Release.Name means that the same chart can be installed 55 # multiple times into the same namespace. 56 name: {{ template "nginx.fullname" . }} 57 labels: 58 # The "heritage" label is used to track which tool deployed a given chart. 59 # It is useful for admins who want to see what releases a particular tool 60 # is responsible for. 61 heritage: {{ .Release.Service }} 62 # The "release" convention makes it easy to tie a release to all of the 63 # Kubernetes resources that were created as part of that release. 64 release: {{ .Release.Name }} 65 # This makes it easy to audit chart usage. 66 chart: {{ .Chart.Name }}-{{ .Chart.Version }} 67 app: {{ template "nginx.name" . }} 68 spec: 69 replicas: {{ .Values.replicaCount }} 70 template: 71 metadata: 72 {{- if .Values.podAnnotations }} 73 # Allows custom annotations to be specified 74 annotations: 75 {{ toYaml .Values.podAnnotations | indent 8 }} 76 {{- end }} 77 labels: 78 app: {{ template "nginx.name" . }} 79 release: {{ .Release.Name }} 80 spec: 81 containers: 82 - name: {{ template "nginx.name" . }} 83 image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 84 imagePullPolicy: {{ .Values.image.pullPolicy }} 85 ports: 86 - name: http 87 containerPort: 80 88 protocol: TCP 89 # This (and the volumes section below) mount the config map as a volume. 90 volumeMounts: 91 - mountPath: /usr/share/nginx/html 92 name: wwwdata-volume 93 resources: 94 # Allow chart users to specify resources. Usually, no default should be set, so this is left to be a conscious 95 # choice to the chart users and avoids that charts don't run out of the box on, e. g., Minikube when high resource 96 # requests are specified by default. 97 {{ toYaml .Values.resources | indent 12 }} 98 {{- if .Values.nodeSelector }} 99 nodeSelector: 100 # Node selectors can be important on mixed Windows/Linux clusters. 101 {{ toYaml .Values.nodeSelector | indent 8 }} 102 {{- end }} 103 volumes: 104 - name: wwwdata-volume 105 configMap: 106 name: {{ template "nginx.fullname" . }} 107 - inline: 108 dest: charts/src/nginx/templates/_helpers.tpl 109 contents: | 110 {{/* vim: set filetype=mustache: */}} 111 {{/* 112 Expand the name of the chart. 113 */}} 114 {{- define "nginx.name" -}} 115 {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 116 {{- end -}} 117 118 {{/* 119 Create a default fully qualified app name. 120 We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 121 */}} 122 {{- define "nginx.fullname" -}} 123 {{- $name := default .Chart.Name .Values.nameOverride -}} 124 {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 125 {{- end -}} 126 127 128 - inline: 129 dest: charts/src/nginx/templates/service.yaml 130 contents: | 131 apiVersion: v1 132 kind: Service 133 metadata: 134 {{- if .Values.service.annotations }} 135 annotations: 136 {{ toYaml .Values.service.annotations | indent 4 }} 137 {{- end }} 138 labels: 139 app: {{ template "nginx.name" . }} 140 chart: {{ .Chart.Name }}-{{ .Chart.Version }} 141 heritage: {{ .Release.Service }} 142 release: {{ .Release.Name }} 143 name: {{ template "nginx.fullname" . }} 144 spec: 145 # Provides options for the service so chart users have the full choice 146 type: "{{ .Values.service.type }}" 147 clusterIP: "{{ .Values.service.clusterIP }}" 148 {{- if .Values.service.externalIPs }} 149 externalIPs: 150 {{ toYaml .Values.service.externalIPs | indent 4 }} 151 {{- end }} 152 {{- if .Values.service.loadBalancerIP }} 153 loadBalancerIP: "{{ .Values.service.loadBalancerIP }}" 154 {{- end }} 155 {{- if .Values.service.loadBalancerSourceRanges }} 156 loadBalancerSourceRanges: 157 {{ toYaml .Values.service.loadBalancerSourceRanges | indent 4 }} 158 {{- end }} 159 ports: 160 - name: http 161 port: {{ .Values.service.port }} 162 protocol: TCP 163 targetPort: http 164 {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }} 165 nodePort: {{ .Values.service.nodePort }} 166 {{- end }} 167 selector: 168 app: {{ template "nginx.name" . }} 169 release: {{ .Release.Name }} 170 171 - inline: 172 dest: charts/src/nginx/values.yaml 173 contents: | 174 # Default values for nginx. 175 # This is a YAML-formatted file. 176 # Declare name/value pairs to be passed into your templates. 177 178 replicaCount: 1 179 restartPolicy: Never 180 181 # Evaluated by the post-install hook 182 sleepyTime: "10" 183 184 index: >- 185 <h1>Hello</h1> 186 <p>This is a test</p> 187 188 image: 189 repository: nginx 190 tag: 1.11.0 191 pullPolicy: IfNotPresent 192 193 service: 194 annotations: {} 195 clusterIP: "" 196 externalIPs: [] 197 loadBalancerIP: "" 198 loadBalancerSourceRanges: [] 199 type: ClusterIP 200 port: 8888 201 nodePort: "" 202 203 podAnnotations: {} 204 205 resources: {} 206 207 nodeSelector: {} 208 - helm: 209 dest: charts/rendered/ 210 local: 211 chart_root: installer/charts/src/nginx 212 config: {} 213 lifecycle: 214 v1: 215 - render: {}