mirror of
https://github.com/holos-run/holos.git
synced 2026-03-20 17:25:01 +00:00
Our guides should be useful reading them only from a mobile device. For those readers who also want to apply the manifests to a real cluster we need a companion guide that describes how to get one. This patch adds that guide, adapted from the old try holos locally page.
39 lines
807 B
Bash
Executable File
39 lines
807 B
Bash
Executable File
#! /bin/bash
|
|
#
|
|
|
|
set -euo pipefail
|
|
|
|
mkcert --install
|
|
|
|
tmpdir="$(mktemp -d)"
|
|
finish() {
|
|
[[ -d "$tmpdir" ]] && rm -rf "$tmpdir"
|
|
}
|
|
trap finish EXIT
|
|
cd "$tmpdir"
|
|
|
|
# Create the local CA Secret with ca.crt, tls.crt, tls.key
|
|
|
|
mkdir local-ca
|
|
cd local-ca
|
|
CAROOT="$(mkcert -CAROOT)"
|
|
cp -p "${CAROOT}/rootCA.pem" ca.crt
|
|
cp -p "${CAROOT}/rootCA.pem" tls.crt
|
|
cp -p "${CAROOT}/rootCA-key.pem" tls.key
|
|
kubectl create secret generic --from-file=. --dry-run=client -o yaml local-ca > ../local-ca.yaml
|
|
cd ..
|
|
|
|
echo 'type: kubernetes.io/tls' >> local-ca.yaml
|
|
kubectl apply --server-side=true -f- <<EOF
|
|
apiVersion: v1
|
|
kind: Namespace
|
|
metadata:
|
|
labels:
|
|
kubernetes.io/metadata.name: cert-manager
|
|
name: cert-manager
|
|
spec:
|
|
finalizers:
|
|
- kubernetes
|
|
EOF
|
|
kubectl apply -n cert-manager --server-side=true -f local-ca.yaml
|