Open falseneutral opened 5 years ago
Do we have to mount the TLS cert/key using a secret ?
As of now image: sha256:1ecc9fb2c871302fdb57a25e0c076311b7b352b0a9246d442940ca8fb4efe229
you need to mount the certificate key pair here: /tls/kuard.crt
and /tls/kuard.key
In Kubernetes I did the following - I use cert-manager for kind: Certificate
:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: kuard
name: kuard
namespace: foobar
spec:
replicas: 1
selector:
matchLabels:
app: kuard
template:
metadata:
labels:
app: kuard
spec:
containers:
- image: nexus-docker.cntr.swsnet.ch/kuar-demo/kuard-amd64:blue
name: kuard-amd64
ports:
- containerPort: 8080
name: http
protocol: TCP
- containerPort: 8443
name: https
protocol: TCP
volumeMounts:
- name: certificates
mountPath: /tls
readOnly: true
volumes:
- name: certificates
secret:
secretName: kuard-certificate
items:
- key: tls.crt
path: kuard.crt
- key: tls.key
path: kuard.key
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: kuard-certificate
namespace: foobar
spec:
secretName: kuard-certificate
commonName: kuard
privateKey:
algorithm: ECDSA
rotationPolicy: Always
size: 384
usages:
- digital signature
- key encipherment
- server auth
dnsNames:
- localhost
- kuard
- kuard.foobar
- kuard.foobar.svc
- kuard.foobar.svc.cluster.local
issuerRef:
name: ca-issuer
kind: ClusterIssuer
Started the container (
docker run --rm -p 8080:8000 kuart
) and got the following outputAny ideas what needs to be in place for this to work?