Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
irt-public
gcloud-scripts
Commits
c13fba3c
Commit
c13fba3c
authored
Oct 12, 2017
by
Christopher Pauley
Browse files
helm external dns
parent
295d6e8c
Changes
27
Hide whitespace changes
Inline
Side-by-side
functions.sh
View file @
c13fba3c
...
...
@@ -26,6 +26,10 @@ err_report() {
}
trap_errors
()
{
if
[
"
$debug_scripts
"
=
"true"
]
;
then
set
-x
fi
set
-eeuo
pipefail
trap
'err_report $BASH_SOURCE $LINENO'
err
export
shellopts
...
...
gomplate-includes/vault-base64.tmpl
0 → 100644
View file @
c13fba3c
{{ define "vault-base64" }}{{ $response := (ds "vault" .) }}{{ if eq $response.format "text" }}{{ base64.Encode $response.value }}{{ else if eq $response.format "base64" }}{{ $response.value }}{{ end }}{{ end }}
\ No newline at end of file
gomplate-includes/vault-text.tmpl
0 → 100644
View file @
c13fba3c
{{ define "vault-text" }}{{ $response := (ds "vault" .) }}{{ if eq $response.format "base64" }}{{ base64.Decode $response.value }}{{ else if eq $response.format "text" }}{{ $response.value }}{{ end }}{{ end }}
\ No newline at end of file
gomplate.sh
0 → 100755
View file @
c13fba3c
#!/bin/bash
###############################################################################
# Call gomplate w/ our custom functions from gomplate-includes
###############################################################################
THIS_DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
DRONE_BASE_DIR
=
"
${
DRONE_BASE_DIR
:-
.
}
"
# include functions
source
$THIS_DIR
/functions.sh
templates_dir
=
$SCRIPTS_DIR
/gomplate-includes
# fail on error or undeclared vars
trap_errors
# cat includes in templates_dir and stdin together
cat
$templates_dir
/
*
.tmpl - | gomplate
-d
vault
=
"vault://"
"
$@
"
\ No newline at end of file
helm-charts/external-dns
/0.1.0
/.helmignore
→
helm-charts/external-dns
-test/external-dns
/.helmignore
View file @
c13fba3c
File moved
helm-charts/external-dns-test/external-dns/Chart.yaml
0 → 100644
View file @
c13fba3c
apiVersion
:
v1
description
:
A Helm chart for Kubernetes
name
:
external-dns
version
:
0.1.0
helm-charts/external-dns-test/external-dns/templates/NOTES.txt
0 → 100644
View file @
c13fba3c
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range .Values.ingress.hosts }}
http://{{ . }}
{{- end }}
{{- else 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_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- 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}')
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 "name" . }},release={{ .Release.Name }}" -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.internalPort }}
{{- end }}
helm-charts/external-dns
/0.1.0
/templates/_helpers.tpl
→
helm-charts/external-dns
-test/external-dns
/templates/_helpers.tpl
View file @
c13fba3c
File moved
helm-charts/external-dns-test/external-dns/templates/deployment.yaml
0 → 100644
View file @
c13fba3c
apiVersion
:
extensions/v1beta1
kind
:
Deployment
metadata
:
name
:
{{
template "fullname" .
}}
labels
:
app
:
{{
template "name" .
}}
chart
:
{{
.Chart.Name
}}
-{{ .Chart.Version | replace "+" "_" }}
release
:
{{
.Release.Name
}}
heritage
:
{{
.Release.Service
}}
spec
:
replicas
:
{{
.Values.replicaCount
}}
template
:
metadata
:
labels
:
app
:
{{
template "name" .
}}
release
:
{{
.Release.Name
}}
spec
:
containers
:
-
name
:
{{
.Chart.Name
}}
image
:
"
{{
.Values.image.repository
}}:{{
.Values.image.tag
}}"
imagePullPolicy
:
{{
.Values.image.pullPolicy
}}
ports
:
-
containerPort
:
{{
.Values.service.internalPort
}}
livenessProbe
:
httpGet
:
path
:
/
port
:
{{
.Values.service.internalPort
}}
readinessProbe
:
httpGet
:
path
:
/
port
:
{{
.Values.service.internalPort
}}
resources
:
{{
toYaml .Values.resources | indent 12
}}
{{
- if .Values.nodeSelector
}}
nodeSelector
:
{{
toYaml .Values.nodeSelector | indent 8
}}
{{
- end
}}
helm-charts/external-dns-test/external-dns/templates/ingress.yaml
0 → 100644
View file @
c13fba3c
{{
- if .Values.ingress.enabled -
}}
{{
- $serviceName
:
= include "fullname" . -
}}
{{
- $servicePort
:
= .Values.service.externalPort -
}}
apiVersion
:
extensions/v1beta1
kind
:
Ingress
metadata
:
name
:
{{
template "fullname" .
}}
labels
:
app
:
{{
template "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
:
{{
- range $host
:
= .Values.ingress.hosts
}}
-
host
:
{{
$host
}}
http
:
paths
:
-
path
:
/
backend
:
serviceName
:
{{
$serviceName
}}
servicePort
:
{{
$servicePort
}}
{{
- end -
}}
{{
- if .Values.ingress.tls
}}
tls
:
{{
toYaml .Values.ingress.tls | indent 4
}}
{{
- end -
}}
{{
- end -
}}
helm-charts/external-dns-test/external-dns/templates/service.yaml
0 → 100644
View file @
c13fba3c
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
{{
template "fullname" .
}}
labels
:
app
:
{{
template "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 "name" .
}}
release
:
{{
.Release.Name
}}
helm-charts/external-dns-test/external-dns/values.yaml
0 → 100644
View file @
c13fba3c
# Default values for external-dns.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount
:
1
image
:
repository
:
nginx
tag
:
stable
pullPolicy
:
IfNotPresent
service
:
name
:
nginx
type
:
ClusterIP
externalPort
:
80
internalPort
:
80
ingress
:
enabled
:
false
# 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
helm-charts/external-dns-test/templates/service.yaml
View file @
c13fba3c
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
{{
template "fullname" .
}}
name
:
{{
.Release.Name
}}
labels
:
app
:
{{
template "name" .
}}
chart
:
{{
.Chart.Name
}}
-{{ .Chart.Version | replace "+" "_" }}
release
:
{{
.Release.Name
}}
heritage
:
{{
.Release.Service
}}
annotations
:
external-dns.alpha.kubernetes.io/hostname
:
nginx-test.somsvc.stanford.edu
spec
:
type
:
{{
.Values.service.type
}}
type
:
LoadBalancer
ports
:
-
port
:
{{
.Values.service.externalPort
}}
targetPort
:
{{
.Values.service.internalPort
}}
protocol
:
TCP
name
:
{{
.Values.service.name
}}
-
port
:
80
targetPort
:
80
selector
:
app
:
{{
template "name" .
}}
release
:
{{
.Release.Name
}}
app
:
{{
.Release.Name
}}
-nginx
\ No newline at end of file
helm-charts/external-dns/0.1.0/chart/.helmignore
0 → 100644
View file @
c13fba3c
# 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
helm-charts/external-dns/0.1.0/Chart.yaml
→
helm-charts/external-dns/0.1.0/
chart/
Chart.yaml
View file @
c13fba3c
File moved
helm-charts/external-dns/0.1.0/templates/NOTES.txt
→
helm-charts/external-dns/0.1.0/
chart/
templates/NOTES.txt
View file @
c13fba3c
File moved
helm-charts/external-dns/0.1.0/chart/templates/_helpers.tpl
0 → 100644
View file @
c13fba3c
{{
/*
vim
:
set
filetype
=
mustache
:
*/
}}
{
{
/*
Expand
the
name
of
the
chart
.
*/
}
}
{{- define "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 "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
helm-charts/external-dns/0.1.0/templates/deployment.yaml
→
helm-charts/external-dns/0.1.0/
chart/
templates/deployment.yaml
View file @
c13fba3c
File moved
helm-charts/external-dns/0.1.0/templates/secret.yml
→
helm-charts/external-dns/0.1.0/
chart/
templates/secret.yml
View file @
c13fba3c
File moved
helm-charts/external-dns/0.1.0/values.yaml
→
helm-charts/external-dns/0.1.0/
chart/
values.yaml
View file @
c13fba3c
File moved
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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