Frankenetes TLS overview ๐
Define what certs I want in the tls directory
- ca-config.json defines my Certificate Authority
- Individual
-csr.json
files represent individual certs / Kubernetes user accounts - All certs are signed by the CA, which allows the k8s api server to trust their authenticity
CN=
corresponds to a k8s userO=
corresponds to a k8s group. There can be multiple
I use
az storage file upload-batch
to put my configuration & create-certs.sh script in an Azure File shareI use cfssl to create certs in an Azure Container Instance
- Calls to ACI are here
- This is a horrible idea - production certs should not be generated on other peoples’ machines in an online environment
- I’m mounting the Azure File share to launch the script, read certificate requests, and drop public/private keys back to the share
I download the
.pem
files from the Azure File shareI create
kubeconfig
s for each user. This includes core component roles (controller manager, scheduler) and nodes (virtual kubelet)- Some of these have magic permissions because of their names - details here
- I use some of these later to assign ClusterRoleBindings to
For each control plane role (api server, controller manager, scheduler) and node, I create an Azure File share & upload the certs &
kubeconfig
as neededWhen I launch each control plane role, I mountthe corresponding Azure File share and reference the cert/
kubeconfig
as needed in the startup argumentsLocally, I use the
admin.kubeconfig
. I’ve said that I am in thesystem:masters
group in the cert, so I can do whatever I wantI can also verify that things are working as expected by authenticating via the client certificates with
curl
oretcdctl
. Ex:
# list everything in etcd
ETCDCTL_API=3 ~/temp/etcd328/etcd-v3.2.8-linux-amd64/etcdctl --endpoints=https://frankenetes-etcd.eastus.azurecontainer.io:2379 --cacert=output/ca.pem --cert=output/etcd.pem --key=output/etcd-key.pem get / --prefix=true
# get the version from the k8s api server
curl --cacert output/ca.pem --cert output/admin.pem --key output/admin-key.pem https://frankenetes-apiserver.eastus.azurecontainer.io:6443/version