Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
k8s-ingress
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
uplex-varnish
k8s-ingress
Commits
e2060a7e
Commit
e2060a7e
authored
Aug 14, 2020
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Package the "hello world" example as a helm chart. Passes verify.sh.
parent
204d5a20
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
214 additions
and
0 deletions
+214
-0
.helmignore
examples/hello/charts/.helmignore
+21
-0
Chart.yaml
examples/hello/charts/Chart.yaml
+5
-0
_helpers.tpl
examples/hello/charts/templates/_helpers.tpl
+43
-0
deployment.yaml
examples/hello/charts/templates/deployment.yaml
+39
-0
ingress.yaml
examples/hello/charts/templates/ingress.yaml
+26
-0
service.yaml
examples/hello/charts/templates/service.yaml
+26
-0
values.yaml
examples/hello/charts/values.yaml
+26
-0
deploy_helm.sh
examples/hello/deploy_helm.sh
+3
-0
undeploy_helm.sh
examples/hello/undeploy_helm.sh
+9
-0
values.yaml
examples/hello/values.yaml
+16
-0
No files found.
examples/hello/charts/.helmignore
0 → 100644
View file @
e2060a7e
# 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
examples/hello/charts/Chart.yaml
0 → 100644
View file @
e2060a7e
apiVersion
:
v2
name
:
viking-ingress
version
:
0.1.0
description
:
Ingress and backend Services/Deployments using Viking Ingress
engine
:
gotpl
examples/hello/charts/templates/_helpers.tpl
0 → 100644
View file @
e2060a7e
{{
/*
vim
:
set
filetype
=
mustache
:
*/
}}
{
{
/*
Expand
the
name
of
the
chart
.
*/
}
}
{{- define "viking-ingress.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{
{
/*
Create
chart
name
and
version
as
used
by
the
chart
label
.
*/
}
}
{{- define "viking-ingress.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | 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 "viking-ingress.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{
{
/*
Common
labels
*/
}
}
{{- define "viking-ingress.labels" -}}
helm.sh/chart: {{ include "viking-ingress.chart" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
examples/hello/charts/templates/deployment.yaml
0 → 100644
View file @
e2060a7e
{{
range $name
,
$app
:
= .Values.apps
}}
apiVersion
:
apps/v1
kind
:
Deployment
metadata
:
labels
:
app.kubernetes.io/name
:
{{
$name
}}
app.kubernetes.io/component
:
ingressBackend
helm.sh/chart
:
{{
printf "%s-%s" $.Chart.Name $.Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-"
}}
{{
- if $.Chart.AppVersion
}}
app.kubernetes.io/version
:
{{
$.Chart.AppVersion | quote
}}
{{
- end
}}
app.kubernetes.io/managed-by
:
{{
$.Release.Service
}}
app.kubernetes.io/instance
:
{{
$.Release.Name
}}
name
:
{{
$name
}}
spec
:
replicas
:
{{
default "1" $app.replicas
}}
selector
:
matchLabels
:
app.kubernetes.io/name
:
{{
$name
}}
app.kubernetes.io/instance
:
{{
$.Release.Name
}}
template
:
metadata
:
labels
:
app.kubernetes.io/name
:
{{
$name
}}
app.kubernetes.io/component
:
ingressBackend
helm.sh/chart
:
{{
printf "%s-%s" $.Chart.Name $.Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-"
}}
{{
- if $.Chart.AppVersion
}}
app.kubernetes.io/version
:
{{
$.Chart.AppVersion | quote
}}
{{
- end
}}
app.kubernetes.io/managed-by
:
{{
$.Release.Service
}}
app.kubernetes.io/instance
:
{{
$.Release.Name
}}
spec
:
containers
:
-
name
:
{{
$name
}}
image
:
{{
$app.image
}}
ports
:
-
containerPort
:
{{
default "80" $app.containerPort
}}
---
{{
end
}}
examples/hello/charts/templates/ingress.yaml
0 → 100644
View file @
e2060a7e
apiVersion
:
extensions/v1beta1
kind
:
Ingress
metadata
:
name
:
{{
include "viking-ingress.fullname" .
}}
labels
:
app.kubernetes.io/name
:
{{
include "viking-ingress.name" .
}}
app.kubernetes.io/component
:
ingress
{{
- include "viking-ingress.labels" . | nindent 4
}}
annotations
:
kubernetes.io/ingress.class
:
{{
.Values.ingress.class
}}
{{
- with .Values.ingress.annotations
}}
{{
- toYaml . | nindent 4
}}
{{
- end
}}
spec
:
rules
:
{{
- range $rule
:
= .Values.ingress.rules
}}
-
host
:
{{
$rule.host
}}
http
:
paths
:
{{
- range $path
:
= $rule.paths
}}
-
path
:
{{
$path.path
}}
backend
:
serviceName
:
{{
$path.app
}}
-svc
servicePort
:
{{
default "80" $path.servicePort
}}
{{
- end
}}
{{
- end
}}
examples/hello/charts/templates/service.yaml
0 → 100644
View file @
e2060a7e
{{
range $name
,
$app
:
= .Values.apps
}}
apiVersion
:
v1
kind
:
Service
metadata
:
labels
:
app.kubernetes.io/name
:
{{
$name
}}
-svc
app.kubernetes.io/component
:
ingressBackend
helm.sh/chart
:
{{
printf "%s-%s" $.Chart.Name $.Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-"
}}
{{
- if $.Chart.AppVersion
}}
app.kubernetes.io/version
:
{{
$.Chart.AppVersion | quote
}}
{{
- end
}}
app.kubernetes.io/managed-by
:
{{
$.Release.Service
}}
app.kubernetes.io/instance
:
{{
$.Release.Name
}}
name
:
{{
$name
}}
-svc
spec
:
ports
:
-
port
:
{{
default "80" $app.servicePort
}}
targetPort
:
{{
default "80" $app.targetPort
}}
protocol
:
TCP
name
:
http
selector
:
app.kubernetes.io/name
:
{{
$name
}}
app.kubernetes.io/component
:
ingressBackend
app.kubernetes.io/instance
:
{{
$.Release.Name
}}
---
{{
end
}}
examples/hello/charts/values.yaml
0 → 100644
View file @
e2060a7e
# Map of Ingress backend apps, keys are app names.
apps
:
example
:
image
:
uplex/http-echo
# replicas: 1
## containerPort for the pod template ports spec
## servicePort for Service spec.ports.port
## targetPort for Service spec.ports.targetPort
# containerPort: 80
# servicePort: 80
# targetPort: 80
ingress
:
# Must match the Ingress class observed by the controller.
class
:
"
varnish"
# Ingress rules
rules
:
-
host
:
example.com
paths
:
-
path
:
/
app
:
example
# servicePort: 80
\ No newline at end of file
examples/hello/deploy_helm.sh
0 → 100755
View file @
e2060a7e
#! /bin/bash -ex
helm
install
viking-ingress ./charts
--values
values.yaml
examples/hello/undeploy_helm.sh
0 → 100755
View file @
e2060a7e
#! /bin/bash -ex
MYDIR
=
$(
dirname
${
BASH_SOURCE
[0]
})
source
${
MYDIR
}
/../../test/utils.sh
helm uninstall viking-ingress
echo
"Waiting until varnish-ingress Pods are not configured for Ingress"
wait_until_not_configured
app
=
varnish-ingress
examples/hello/values.yaml
0 → 100644
View file @
e2060a7e
apps
:
coffee
:
image
:
nginxdemos/hello:plain-text
replicas
:
2
tea
:
image
:
nginxdemos/hello:plain-text
replicas
:
3
ingress
:
rules
:
-
host
:
cafe.example.com
paths
:
-
path
:
/tea
app
:
tea
-
path
:
/coffee
app
:
coffee
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment