Sylvain Desbureaux | da711dd | 2021-04-07 17:22:42 +0200 | [diff] [blame^] | 1 | #!/bin/sh |
| 2 | |
| 3 | {{/* |
| 4 | # Copyright © 2020 Orange |
| 5 | # |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
| 17 | */ -}} |
| 18 | |
| 19 | echo "*** retrieving certificates and keys" |
| 20 | export CRT=$(cat {{ .Values.credsPath }}/certs/tls.crt | base64 -w 0) |
| 21 | export KEY=$(cat {{ .Values.credsPath }}/certs/tls.key | base64 -w 0) |
| 22 | export CACERT=$(cat {{ .Values.credsPath }}/certs/cacert.pem | base64 -w 0) |
| 23 | echo "*** creating tls secret" |
| 24 | cat <<EOF | kubectl apply -f - |
| 25 | apiVersion: v1 |
| 26 | kind: Secret |
| 27 | metadata: |
| 28 | name: {{ tpl .Values.ingressTlsSecret . }} |
| 29 | namespace: {{ include "common.namespace" . }} |
| 30 | data: |
| 31 | ca.crt: "${CACERT}" |
| 32 | tls.crt: "${CRT}" |
| 33 | tls.key: '${KEY}' |
| 34 | type: kubernetes.io/tls |
| 35 | EOF |