I have deployed vault on k8s. See below :
========
NAME READY STATUS RESTARTS AGE
consul-0 1/1 Running 0 2h
consul-1 1/1 Running 0 2h
consul-2 1/1 Running 0 2h
vault-64bf65fff5-fpbvq 2/2 Running 0 2h
vault-64bf65fff5-mkp4s 2/2 Running 0 2h
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
consul ClusterIP None <none> 8500/TCP,8443/TCP,8400/TCP,8301/TCP,8301/UDP,8302/TCP,8302/UDP,8300/TCP,8600/TCP 3d
kubernetes ClusterIP 10.0.0.1 <none> 443/TCP 140d 4d
vault ClusterIP 10.0.0.216 <none> 8200/TCP
==============
I am able to run vault cli from my workstation with kubectl port-forward on as below
============
vault write auth/kubernetes/login role=postgres jwt=$KUBE_TOKEN
Handling connection for 8200
Key Value
--- -----
token 6tuCz3C3qCbFnpwX568lZM1D
token_accessor 4ViFbHlsgFjLIqmL73ayNe68
token_duration 24h
token_renewable true
token_policies ["default" "postgres-policy"]
identity_policies []
policies ["default" "postgres-policy"]
token_meta_role postgres
token_meta_service_account_name postgres-vault
token_meta_service_account_namespace default
token_meta_service_account_secret_name postgres-vault-token-fc98g
token_meta_service_account_uid 3fbde507-2760-11e9-b514-0050569602bb
===============
But I am not able to call vault api for the same commands. Pls guide me what's is missing ..
===============
curl \
> --request POST \
> --data @payload.json \
Handling connection for 8200
even with https
Handling connection for 8200
curl: (60) Peer's certificate has an invalid signature.
curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacerE0206 14:23:42.924575 12069 portforward.go:316] error copying from local connection to remote stream: read tcp4 127.0.0.1:8200->
127.0.0.1:32858: read: connection reset by peer
t option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
===================
My payload.json contains
{
"role": "postgres",
"jwt": "eyJ..."
}
===================
vault status
Handling connection for 8200
Key Value
--- -----
Seal Type shamir
Initialized true
Sealed false
Total Shares 1
Threshold 1
Version 0.11.5
Cluster Name vault-cluster-2ac865f1
Cluster ID 36d4728b-b280-decc-efda-409c534d8a8b
HA Enabled true
HA Mode active
============
Any help will be appreciated ..
Thanks and Regards
Manojit