I am following this tutorial:
https://www.cockroachlabs.com/docs/stable/orchestrate-cockroachdb-with-kubernetes.html
All goes well until the step “Initialize the cluster”-step.
I downloaded the example.yaml and applied it.
$ kubectl get all
pod/cockroachdb-0 0/1 CrashLoopBackOff 7 14m
When I check the logs it says:
I210127 10:26:48.858545 1 util/log/flags.go:106 stderr capture started
I210127 10:26:48.865177 1 cli/start.go:1163 ⋮ ‹CockroachDB CCL v20.2.0 (x86_64-unknown-linux-gnu, built 2020/11/09 16:01:45, go1.13.14)›
I210127 10:26:48.888689 1 server/config.go:433 ⋮ system total memory: ‹8.0 GiB›
I210127 10:26:48.888791 1 server/config.go:435 ⋮ server configuration:
‹max offset 500000000›
‹cache size 2.0 GiB›
‹SQL memory pool size 2.0 GiB›
‹scan interval 10m0s›
‹scan min idle time 10ms›
‹scan max idle time 1s›
‹event log enabled true›
I210127 10:26:48.888877 1 cli/start.go:960 ⋮ using local environment variables: ‹COCKROACH_CHANNEL=kubernetes-operator›
I210127 10:26:48.888895 1 cli/start.go:967 ⋮ process identity: ‹uid 0 euid 0 gid 0 egid 0›
I210127 10:26:48.892451 1 cli/start.go:503 ⋮ GEOS loaded from directory ‹/usr/local/lib/cockroach›
I210127 10:26:48.892501 1 cli/start.go:508 ⋮ starting cockroach node
W210127 10:26:48.892950 98 security/certificate_loader.go:353 ⋮ could not parse certificate for ‹/cockroach/cockroach-certs/client.root.crt›: empty certificate file: ‹client.root.crt›
W210127 10:26:48.893035 98 security/certificate_loader.go:353 ⋮ could not parse certificate for ‹/cockroach/cockroach-certs/node.crt›: empty certificate file: ‹node.crt›
E210127 10:26:48.893824 1 cli/error.go:398 ⋮ ‹ERROR: cannot load certificates.›
‹Check your certificate settings, set --certs-dir, or use --insecure for insecure clusters.›
‹failed to start server: problem using security settings: empty certificate file: node.crt›
ERROR: cannot load certificates.
Check your certificate settings, set --certs-dir, or use --insecure for insecure clusters.
failed to start server: problem using security settings: empty certificate file: node.crt
Failed running “start”
My plan was to go inside the pod and create the certificates, but since it’s never up and running I can’t get inside the pod. Any ideas how I can solve this?