cockroachdb / cockroachdb/k8s

request-cert type client

Open
#16 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
25
Forks
25
PR merge metrics
No merged PRs in 30d

Description

request-cert type node works but type client give me the following error

```
initContainers:
- name: init-certs
image: cockroachdb/cockroach-k8s-request-cert:0.4
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
volumeMounts:
- name: certs
mountPath: /cockroach-certs
- name: client
mountPath: /cockroach-client
command:
- "/bin/ash"
- "-xec"
# - "/request-cert -namespace=${POD_NAMESPACE} -certs-dir=/cockroach-certs -type=node -addresses=localhost,127.0.0.1,$(hostname -f),$(hostname -f | cut -f 1-2 -d '.'),cockroach-lb,cockroachdb-lb.$(hostname -f | cut -f 3- -d '.') -symlink-ca-from=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt;"
- "/request-cert -namespace=${POD_NAMESPACE} -certs-dir=/cockroach-client -type=client -user=root -symlink-ca-from=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
```
```
% kubectl get csr
NAME AGE REQUESTOR CONDITION
default.client.root 18m system:serviceaccount:default:cockroach Approved,Issued
default.node.cockroach-0 51m system:serviceaccount:default:cockroach Approved,Issued
default.node.cockroach-1 48m system:serviceaccount:default:cockroach Approved,Issued
default.node.cockroach-2 48m system:serviceaccount:default:cockroach Approved,Issued
```
```
+ /request-cert '-namespace=default' '-certs-dir=/cockroach-client' '-type=client' '-user=root' '-symlink-ca-from=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt'
2018/10/29 04:06:51 Looking up cert and key under secret default.client.root
W1029 04:06:51.502966 1 client_config.go:529] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
2018/10/29 04:06:51 Secret default.client.root not found, sending CSR
Sending create request: default.client.root for
2018/10/29 04:06:51 failed to get certificate: CertificateSigningRequest.Create(default.client.root) failed: certificatesigningrequests.certificates.k8s.io "default.client.root" already exists
```
![image](https://user-images.githubusercontent.com/863731/47629131-a012b700-db39-11e8-8cbe-dc2aa972fb67.png)
PS Not related to the problem but what's the best way to combine node and client cmd into one init cmd? Tried `;` but that doesn't work for me.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.