Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
Charts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
魏国强
Charts
Commits
022e85f6
Commit
022e85f6
authored
Aug 09, 2021
by
sonicaj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dynamically retrieve minio scheme and set it appropriately
parent
1c9df484
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
11 deletions
+16
-11
test/minio/1.3.11/questions.yaml
test/minio/1.3.11/questions.yaml
+1
-1
test/minio/1.3.11/templates/_helpers.tpl
test/minio/1.3.11/templates/_helpers.tpl
+12
-0
test/minio/1.3.11/templates/configmap.yaml
test/minio/1.3.11/templates/configmap.yaml
+1
-5
test/minio/1.3.11/templates/deployment.yaml
test/minio/1.3.11/templates/deployment.yaml
+2
-2
test/minio/1.3.11/templates/secrets.yaml
test/minio/1.3.11/templates/secrets.yaml
+0
-3
No files found.
test/minio/1.3.11/questions.yaml
View file @
022e85f6
...
@@ -147,7 +147,7 @@ questions:
...
@@ -147,7 +147,7 @@ questions:
schema
:
schema
:
type
:
string
type
:
string
default
:
null
default
:
null
null
:
true
"
null"
:
true
show_if
:
[[
"
certificate"
,
"
!="
,
null
]]
show_if
:
[[
"
certificate"
,
"
!="
,
null
]]
-
variable
:
certificate
-
variable
:
certificate
...
...
test/minio/1.3.11/templates/_helpers.tpl
View file @
022e85f6
...
@@ -38,3 +38,15 @@ Retrieve private key of minio certificate
...
@@ -38,3 +38,15 @@ Retrieve private key of minio certificate
{{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.Values.certificate) -}}
{{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.Values.certificate) -}}
{{ include "common.resources.cert" $values }}
{{ include "common.resources.cert" $values }}
{{- end -}}
{{- end -}}
{
{
/*
Retrieve
scheme
/
protocol
for
minio
*/
}
}
{{- define "minio.scheme" -}}
{{- if eq (include "minio.certAvailable" .) "true" -}}
{{- print "https" -}}
{{- else -}}
{{- print "http" -}}
{{- end -}}
{{- end -}}
test/minio/1.3.11/templates/configmap.yaml
View file @
022e85f6
{{
$scheme
:
= "http"
}}
{{
if eq (include "minio.certAvailable" .) "true"
}}
{{
$scheme = "https"
}}
{{
end
}}
apiVersion
:
v1
apiVersion
:
v1
kind
:
ConfigMap
kind
:
ConfigMap
metadata
:
metadata
:
name
:
minio-config
name
:
minio-config
data
:
data
:
protocol
:
{{
$scheme
}}
protocol
:
{{
include "minio.scheme" .
}}
test/minio/1.3.11/templates/deployment.yaml
View file @
022e85f6
...
@@ -43,8 +43,8 @@ spec:
...
@@ -43,8 +43,8 @@ spec:
{{
$secretName
:
= (include "minio.secretName" .)
}}
{{
$secretName
:
= (include "minio.secretName" .)
}}
{{
$envList
:
= (default list .Values.environmentVariables)
}}
{{
$envList
:
= (default list .Values.environmentVariables)
}}
{{
if .Values.minioDomain
}}
{{
if .Values.minioDomain
}}
{{
$envList = mustAppend $envList (dict "name" "MINIO_BROWSER_REDIRECT_URL" "value" (printf "
https
:
//%s
:
%
d" .Values.minioDomain .Values.service.consolePort
))
}}
{{
$envList = mustAppend $envList (dict "name" "MINIO_BROWSER_REDIRECT_URL" "value" (printf "
%s
:
//%s
:
%
d" (include "minio.scheme" .) .Values.minioDomain (.Values.service.consolePort | int)
))
}}
{{
$envList = mustAppend $envList (dict "name" "MINIO_SERVER_URL" "value" (printf "
https
:
//%s
:
%
d" .Values.minioDomain .Values.service.nodePort
))
}}
{{
$envList = mustAppend $envList (dict "name" "MINIO_SERVER_URL" "value" (printf "
%s
:
//%s
:
%
d" (include "minio.scheme" .) .Values.minioDomain (.Values.service.nodePort | int)
))
}}
{{
end
}}
{{
end
}}
{{
$envList = mustAppend $envList (dict "name" "MINIO_ACCESS_KEY" "valueFromSecret" true "secretName" $secretName "secretKey" "accesskey")
}}
{{
$envList = mustAppend $envList (dict "name" "MINIO_ACCESS_KEY" "valueFromSecret" true "secretName" $secretName "secretKey" "accesskey")
}}
{{
$envList = mustAppend $envList (dict "name" "MINIO_SECRET_KEY" "valueFromSecret" true "secretName" $secretName "secretKey" "secretkey")
}}
{{
$envList = mustAppend $envList (dict "name" "MINIO_SECRET_KEY" "valueFromSecret" true "secretName" $secretName "secretKey" "secretkey")
}}
...
...
test/minio/1.3.11/templates/secrets.yaml
View file @
022e85f6
...
@@ -8,9 +8,6 @@ data:
...
@@ -8,9 +8,6 @@ data:
accesskey
:
{{
if .Values.accessKey
}}{{
.Values.accessKey | toString | b64enc | quote
}}{{
else
}}{{
randAlphaNum 20 | b64enc | quote
}}{{
end
}}
accesskey
:
{{
if .Values.accessKey
}}{{
.Values.accessKey | toString | b64enc | quote
}}{{
else
}}{{
randAlphaNum 20 | b64enc | quote
}}{{
end
}}
secretkey
:
{{
if .Values.secretKey
}}{{
.Values.secretKey | toString | b64enc | quote
}}{{
else
}}{{
randAlphaNum 40 | b64enc | quote
}}{{
end
}}
secretkey
:
{{
if .Values.secretKey
}}{{
.Values.secretKey | toString | b64enc | quote
}}{{
else
}}{{
randAlphaNum 40 | b64enc | quote
}}{{
end
}}
{{
if eq (include "minio.certAvailable" .) "true"
}}
{{
if eq (include "minio.certAvailable" .) "true"
}}
{{
if eq .Values.minioDomain null
}}
{{
fail "Minio Domain must be specified when TLS is configured"
}}
{{
end
}}
certPublicKey
:
{{
(include "minio.cert.publicKey" .) | toString | b64enc | quote
}}
certPublicKey
:
{{
(include "minio.cert.publicKey" .) | toString | b64enc | quote
}}
certPrivateKey
:
{{
(include "minio.cert.privateKey" .) | toString | b64enc | quote
}}
certPrivateKey
:
{{
(include "minio.cert.privateKey" .) | toString | b64enc | quote
}}
{{
end
}}
{{
end
}}
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