blob: 9cc5ec580e317d7fbfc08d29cc75fc3e15927429 [file] [log] [blame]
Sylvain Desbureauxda711dd2021-04-07 17:22:42 +02001#!/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
19echo "*** retrieving certificates and keys"
20export CRT=$(cat {{ .Values.credsPath }}/certs/tls.crt | base64 -w 0)
21export KEY=$(cat {{ .Values.credsPath }}/certs/tls.key | base64 -w 0)
22export CACERT=$(cat {{ .Values.credsPath }}/certs/cacert.pem | base64 -w 0)
23echo "*** creating tls secret"
24cat <<EOF | kubectl apply -f -
25apiVersion: v1
26kind: Secret
27metadata:
28 name: {{ tpl .Values.ingressTlsSecret . }}
29 namespace: {{ include "common.namespace" . }}
30data:
31 ca.crt: "${CACERT}"
32 tls.crt: "${CRT}"
33 tls.key: '${KEY}'
34type: kubernetes.io/tls
35EOF