blob: acda777329393f8a8be85d67a08d929782b227e2 [file] [log] [blame]
Vladimir Khlyunevcc648af2024-04-25 19:56:40 +04001set -e
2rm -rf /root/cert && mkdir -p /root/cert && pushd /root/cert
3
4tee ca-config.json << EOF
5{
6 "signing": {
7 "default": {
8 "expiry": "8760h"
9 },
10 "profiles": {
11 "kubernetes": {
12 "usages": [
13 "signing",
14 "key encipherment",
15 "server auth",
16 "client auth"
17 ],
18 "expiry": "8760h"
19 }
20 }
21 }
22}
23EOF
24
25tee ca-csr.json << EOF
26{
27 "CN": "kubernetes",
28 "key": {
29 "algo": "rsa",
30 "size": 2048
31 },
32 "names":[{
33 "C": "EU",
34 "ST": "CZ",
35 "L": "DC",
36 "O": "Mirantis",
37 "OU": "EU BM 2401"
38 }]
39}
40EOF
41
42tee server-csr.json << EOF
43{
Vladimir Khlyunev3f27ff72024-11-01 14:42:24 +040044 "CN": "*.mnt-bm.mirantis.net",
Vladimir Khlyunevcc648af2024-04-25 19:56:40 +040045 "hosts": [
Vladimir Khlyunev3f27ff72024-11-01 14:42:24 +040046 "*.mnt-bm.mirantis.net"
Vladimir Khlyunevcc648af2024-04-25 19:56:40 +040047 ],
48 "key": {
49 "algo": "rsa",
50 "size": 2048
51 },
52 "names": [ {
53 "C": "EU",
54 "L": "DC",
55 "ST": "CZ"
56 }]
57}
58EOF
59cfssl gencert -initca ca-csr.json | cfssljson -bare ca
60cfssl gencert -ca=ca.pem -ca-key=ca-key.pem --config=ca-config.json -profile=kubernetes server-csr.json | cfssljson -bare server
61popd
Vladimir Khlyuneve03b04f2024-04-26 02:57:02 +040062python3 /root/bm_mcc_mosk/utils/tsl_to_yaml.py