【发布时间】:2019-01-29 08:57:49
【问题描述】:
我已经在 kubernetes 中设置了 hashcorp vault server。通过 CLI 或 UI 访问时,Vault 服务器工作正常。我创建了另一个运行我的应用程序的 pod。 但是我无法从运行在不同 pod 上的应用程序访问 Vault Server。
我曾尝试使用 Cluster-IP:Port, IP:Port 但总是看到错误 Connection Refused。
service.yaml
apiVersion: v1
kind: Service
metadata:
name: vault
labels:
run: vault
spec:
type: ClusterIP
ports:
- port: 8080
targetPort: 8200
protocol: TCP
name: vault
selector:
run: vault
deployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: vault
labels:
run: vault
spec:
replicas: 1
template:
metadata:
labels:
run: vault
spec:
containers:
- name: vault
command: ["vault", "server", "-config", "/vault/config/vault.hcl"]
image: "vault"
imagePullPolicy: IfNotPresent
securityContext:
capabilities:
add:
- IPC_LOCK
volumeMounts:
- name: configurations
mountPath: /vault/config/vault.hcl
subPath: vault.hcl
volumes:
- name: configurations
configMap:
name: vault
I need to access vault server from an application running in different pod within same cluster.
【问题讨论】:
-
能分享一下尝试连接Vault的服务的yml文件吗?
标签: kubernetes hashicorp-vault kubernetes-pod kubernetes-cluster