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
f438bbd1
Commit
f438bbd1
authored
Aug 27, 2020
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
viking-test-app chart supports BAsic/Proxy Authentication.
parent
ef6a7016
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
1 deletion
+47
-1
_helpers.tpl
charts/viking-test-app/templates/_helpers.tpl
+9
-0
auth-secrets.yaml
charts/viking-test-app/templates/auth-secrets.yaml
+19
-0
varnishconfig.yaml
charts/viking-test-app/templates/varnishconfig.yaml
+15
-1
values.yaml
charts/viking-test-app/values.yaml
+4
-0
No files found.
charts/viking-test-app/templates/_helpers.tpl
View file @
f438bbd1
...
...
@@ -41,3 +41,12 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{
{
/*
Create
the
k8s
name
of
a
Secret
for
authentication
(
Basic
or
Proxy
)
*/
}
}
{{- define "viking-ingress.authSecretName" -}}
{{- $n := printf "%s-%s-creds" ( include "viking-ingress.fullname" .dot ) .auth.realm | trunc 63 | lower -}}
{{- $name := mustRegexReplaceAll "[^[:alnum:].-]" $n "-" -}}
{{- trimSuffix "-" $name -}}
{{- end }}
charts/viking-test-app/templates/auth-secrets.yaml
0 → 100644
View file @
f438bbd1
{{
- range $auth
:
= .Values.auth
}}
{{
- if not $auth.creds -
}}
{{
- fail "auth element must have a non-empty creds field" -
}}
{{
- end
}}
apiVersion
:
v1
kind
:
Secret
metadata
:
name
:
{{
include "viking-ingress.authSecretName" ( dict "dot" $ "auth" $auth )
}}
labels
:
app.kubernetes.io/name
:
{{
include "viking-ingress.authSecretName" ( dict "dot" $ "auth" $auth )
}}
app.kubernetes.io/component
:
authSecret
viking.uplex.de/secret
:
auth
{{
- include "viking-ingress.labels" $ | nindent 4
}}
data
:
{{
- range $name
,
$secret
:
= $auth.creds
}}
{{
$name
}}:
{{
$secret | b64enc
}}
{{
- end
}}
---
{{
- end
}}
charts/viking-test-app/templates/varnishconfig.yaml
View file @
f438bbd1
{{
if coalesce .Values.acls .Values.vcl (hasKey .Values "selfSharding") -
}}
{{
if coalesce .Values.acls .Values.vcl (hasKey .Values "selfSharding")
.Values.auth
-
}}
{{
if empty .Values.vikingAdmSvc -
}}
{{
fail "Viking admin Service must be specified" -
}}
{{
end -
}}
...
...
@@ -26,4 +26,18 @@ spec:
self-sharding
:
{{
toYaml .Values.selfSharding | nindent 4
}}
{{
- end
}}
{{
- if .Values.auth
}}
auth
:
{{
- range $auth
:
= .Values.auth
}}
{{
- if not $auth.realm -
}}
{{
- fail "auth element must have a realm field" -
}}
{{
- end
}}
-
secretName
:
{{
include "viking-ingress.authSecretName" ( dict "dot" $ "auth" $auth )
}}
{{
- range $k
,
$v
:
= $auth -
}}
{{
- if ne $k "creds" -
}}
{{
toYaml (dict $k $v) | nindent 6
}}
{{
- end
}}
{{
- end
}}
{{
- end
}}
{{
- end
}}
{{
- end
}}
charts/viking-test-app/values.yaml
View file @
f438bbd1
...
...
@@ -47,3 +47,7 @@ vcl: ""
## Configuration for a sharded cache, specify the empty object for default
## config.
# selfSharding: {}
# Authentication (Basic or Proxy) for VarnishConfig.
# Include a field "creds" with a name-value map for credentials.
auth
:
[]
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