Answer the question
In order to leave comments, you need to log in
How to work with TLS in Kubernetes?
Hello!
Introduction:
I have 2 applications (gRPC client and server, though it doesn't matter which) and they need to communicate via TLS. Without Kubernets, everything is quite simple. I create my CA via cfssl in a separate container, get the root certificate and put it in trust for 2 of my grpc applications (in the Dockerfile) so that any certificate signed by my CA will be verified.
Next, Kubernetes comes into play. I'm still playing locally using minikube. I run minikube start on mac (maybe it's important, don't know...)
Problem:
How will this flow work with kuber? As I understand it, there is already a CA inside the cuber (correct if this is not the case). I read a lot of articles, but I didn’t really understand anything. Tried examples from this articlehttps://kubernetes.io/docs/tasks/tls/managing-tls-...
Going through the steps
1) Create a signing request
cat <<EOF | cfssl genkey - | cfssljson -bare server
{
"hosts": [
"my-svc.my-namespace.svc.cluster.local",
"my-pod.my-namespace.pod.cluster.local",
"192.0.2.24",
"10.0.34.2"
],
"CN": "my-pod.my-namespace.pod.cluster.local",
"key": {
"algo": "ecdsa",
"size": 256
}
}
EOF
cat <<EOF | kubectl apply -f -
apiVersion: certificates.k8s.io/v1beta1
kind: CertificateSigningRequest
metadata:
name: my-svc.my-namespace
spec:
request: $(cat server.csr | base64 | tr -d '\n')
usages:
- digital signature
- key encipherment
- server auth
EOF
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question