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
916fd6e6
Commit
916fd6e6
authored
Feb 08, 2021
by
Waqar Ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mount minio configured cert inside pod using secret
parent
31530457
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
10 deletions
+36
-10
test/minio/1.2.0/templates/_cert.tpl
test/minio/1.2.0/templates/_cert.tpl
+25
-0
test/minio/1.2.0/templates/_helpers.tpl
test/minio/1.2.0/templates/_helpers.tpl
+3
-3
test/minio/1.2.0/templates/deployment.yaml
test/minio/1.2.0/templates/deployment.yaml
+4
-3
test/minio/1.2.0/templates/secrets.yaml
test/minio/1.2.0/templates/secrets.yaml
+4
-4
No files found.
test/minio/1.2.0/templates/_cert.tpl
0 → 100644
View file @
916fd6e6
{{
/*
Formats
volumeMount
for
Minio
tls
keys
and
trusted
certs
*/
}}
{{- define "minio.tlsKeysVolumeMount" -}}
{{- if eq (include "minio.certAvailable" .) "true" -}}
- name: cert-secret-volume
mountPath: "/etc/minio/certs"
{{- end }}
{{- end -}}
{
{
/*
Formats
volume
for
Minio
tls
keys
and
trusted
certs
*/
}
}
{{- define "minio.tlsKeysVolume" -}}
{{- if eq (include "minio.certAvailable" .) "true" -}}
- name: cert-secret-volume
secret:
secretName: {{ include "minio.secretName" . }}
items:
- key: certPublicKey
path: public.crt
- key: certPrivateKey
path: private.key
{{- end }}
{{- end -}}
test/minio/1.2.0/templates/_helpers.tpl
View file @
916fd6e6
...
...
@@ -11,7 +11,7 @@ Retrieve true/false if minio certificate is configured
*/
}
}
{{- define "minio.certAvailable" -}}
{{- $values := (. | mustDeepCopy) -}}
{{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.certificate) -}}
{{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.
Values.
certificate) -}}
{{- template "common.resources.cert_present" $values -}}
{{- end -}}
...
...
@@ -21,7 +21,7 @@ Retrieve public key of minio certificate
*/
}
}
{{- define "minio.cert.publicKey" -}}
{{- $values := (. | mustDeepCopy) -}}
{{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.certificate "publicKey" true) -}}
{{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.
Values.
certificate "publicKey" true) -}}
{{ include "common.resources.cert" $values }}
{{- end -}}
...
...
@@ -31,6 +31,6 @@ Retrieve private key of minio certificate
*/
}
}
{{- define "minio.cert.privateKey" -}}
{{- $values := (. | mustDeepCopy) -}}
{{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.certificate) -}}
{{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.
Values.
certificate) -}}
{{ include "common.resources.cert" $values }}
{{- end -}}
test/minio/1.2.0/templates/deployment.yaml
View file @
916fd6e6
{{
$scheme
:
= "http"
}}
apiVersion
:
{{
template "common.capabilities.deployment.apiVersion" .
}}
kind
:
Deployment
metadata
:
...
...
@@ -29,13 +28,14 @@ spec:
containers
:
-
name
:
{{
.Chart.Name
}}
{{
include "common.containers.imageConfig" .Values.image | nindent 10
}}
{{
include "common.storage.allContainerVolumeMounts" .Values | nindent 10
}}
volumeMounts
:
{{
include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12
}}
{{
- include "minio.tlsKeysVolumeMount" . | nindent 12
}}
command
:
-
"
/bin/sh"
-
"
-ce"
-
"
/usr/bin/docker-entrypoint.sh
minio
server
/export
{{
(.Values.extraArgs
|
default
list)
|
join
"
"
}}"
ports
:
-
name
:
{{
$scheme
}}
-
name
:
http
containerPort
:
9000
env
:
{{
$secretName
:
= (include "minio.secretName" .)
}}
...
...
@@ -44,3 +44,4 @@ spec:
{{
$envList = mustAppend $envList (dict "name" "MINIO_SECRET_KEY" "valueFromSecret" true "secretName" $secretName "secretKey" "secretkey")
}}
{{
include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12
}}
{{
include "common.storage.allAppVolumes" .Values | nindent 6
}}
{{
- include "minio.tlsKeysVolume" . | nindent 8
}}
test/minio/1.2.0/templates/secrets.yaml
View file @
916fd6e6
...
...
@@ -7,7 +7,7 @@ type: Opaque
data
:
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
}}
{{
- if eq (include "minio.certAvailable" .) true -
}}
certPublicKey
:
{{
template "minio.cert.publicKey" .
}}
certPrivateKey
:
{{
template "minio.cert.privateKey" .
}}
{{
- end -
}}
{{
if eq (include "minio.certAvailable" .) "true"
}}
certPublicKey
:
{{
(include "minio.cert.publicKey" .) | toString | b64enc | quote
}}
certPrivateKey
:
{{
(include "minio.cert.privateKey" .) | toString | b64enc | quote
}}
{{
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