-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy a helm sample to testdata for integration tests
Signed-off-by: David Gageot <david@gageot.net>
- Loading branch information
Showing
14 changed files
with
192 additions
and
37 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,2 @@ | ||
skaffold-helm | ||
*.swp |
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 @@ | ||
FROM nginx:stable | ||
|
||
COPY static /usr/share/nginx/html/ |
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,21 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj |
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: v1 | ||
description: A Helm chart for Kubernetes | ||
name: skaffold-helm | ||
version: 0.1.0 |
16 changes: 16 additions & 0 deletions
16
integration/testdata/helm/skaffold-helm/templates/_helpers.tpl
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,16 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "skaffold-helm.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
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 "skaffold-helm.fullname" -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} |
29 changes: 29 additions & 0 deletions
29
integration/testdata/helm/skaffold-helm/templates/deployment.yaml
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 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ .Release.Name }} | ||
labels: | ||
app: {{ template "skaffold-helm.name" . }} | ||
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
spec: | ||
replicas: {{ .Values.replicaCount }} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ template "skaffold-helm.name" . }} | ||
release: {{ .Release.Name }} | ||
spec: | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: {{ .Values.image }} | ||
imagePullPolicy: {{ .Values.pullPolicy }} | ||
ports: | ||
- containerPort: {{ .Values.service.internalPort }} | ||
resources: | ||
{{ toYaml .Values.resources | indent 12 }} | ||
{{- if .Values.nodeSelector }} | ||
nodeSelector: | ||
{{ toYaml .Values.nodeSelector | indent 8 }} | ||
{{- end }} |
41 changes: 41 additions & 0 deletions
41
integration/testdata/helm/skaffold-helm/templates/ingress.yaml
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,41 @@ | ||
{{- if .Values.ingress.enabled -}} | ||
{{- $serviceName := include "skaffold-helm.fullname" . -}} | ||
{{- $servicePort := .Values.service.externalPort -}} | ||
apiVersion: extensions/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: {{ template "skaffold-helm.fullname" . }} | ||
labels: | ||
app: {{ template "skaffold-helm.name" . }} | ||
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
annotations: | ||
{{- range $key, $value := .Values.ingress.annotations }} | ||
{{ $key }}: {{ $value | quote }} | ||
{{- end }} | ||
spec: | ||
rules: | ||
{{- if .Values.ingress.hosts }} | ||
{{- range $host := .Values.ingress.hosts }} | ||
- host: {{ $host }} | ||
http: | ||
paths: | ||
- path: / | ||
backend: | ||
serviceName: {{ $serviceName }} | ||
servicePort: {{ $servicePort }} | ||
{{- end -}} | ||
{{- else }} | ||
- http: | ||
paths: | ||
- path: / | ||
backend: | ||
serviceName: {{ $serviceName }} | ||
servicePort: {{ $servicePort }} | ||
{{- end -}} | ||
{{- if .Values.ingress.tls }} | ||
tls: | ||
{{ toYaml .Values.ingress.tls | indent 4 }} | ||
{{- end -}} | ||
{{- end -}} |
19 changes: 19 additions & 0 deletions
19
integration/testdata/helm/skaffold-helm/templates/service.yaml
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,19 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ template "skaffold-helm.fullname" . }} | ||
labels: | ||
app: {{ template "skaffold-helm.name" . }} | ||
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
ports: | ||
- port: {{ .Values.service.externalPort }} | ||
targetPort: {{ .Values.service.internalPort }} | ||
protocol: TCP | ||
name: {{ .Values.service.name }} | ||
selector: | ||
app: {{ template "skaffold-helm.name" . }} | ||
release: {{ .Release.Name }} |
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,39 @@ | ||
# Default values for skaffold-helm. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
replicaCount: 1 | ||
image: nginx:stable | ||
# This is the helm convention on declaring images | ||
# image: | ||
# repository: nginx | ||
# tag: stable | ||
# pullPolicy: IfNotPresent | ||
service: | ||
name: nginx | ||
type: ClusterIP | ||
externalPort: 80 | ||
internalPort: 80 | ||
ingress: | ||
enabled: true | ||
# Used to create an Ingress record. | ||
hosts: | ||
# - chart-example.local | ||
annotations: | ||
# kubernetes.io/ingress.class: nginx | ||
# kubernetes.io/tls-acme: "true" | ||
tls: | ||
# Secrets must be manually created in the namespace. | ||
# - secretName: chart-example-tls | ||
# hosts: | ||
# - chart-example.local | ||
resources: {} | ||
# We usually recommend not to specify default resources and to leave this as a conscious | ||
# choice for the user. This also increases chances charts run on environments with little | ||
# resources, such as Minikube. If you do want to specify resources, uncomment the following | ||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'. | ||
# limits: | ||
# cpu: 100m | ||
# memory: 128Mi | ||
# requests: | ||
# cpu: 100m | ||
# memory: 128Mi |
2 changes: 0 additions & 2 deletions
2
examples/helm-deployment/skaffold-int.yaml → integration/testdata/helm/skaffold.yaml
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,9 @@ | ||
<html lang="en"> | ||
<head> | ||
<title>Skaffold Helm</title> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<h1>Hello world!</h1> | ||
</body> | ||
</html> |
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,6 @@ | ||
h1 { | ||
color: #27aedb; | ||
text-align: center; | ||
margin-top: 40vh; | ||
font-size: 120pt; | ||
} |