在运行 istio 0.8 时,我在尝试使用 cvallance 的 sidecar 部署有状态的 mongodb 副本集时遇到了问题,如果我将 istio 排除在外,一切正常,但是当启用 istio 时,mongo-sidecars 找不到彼此和副本集未配置。下面是我的 mongo 部署和服务。
apiVersion: v1
kind: Service
metadata:
labels:
service: mongo-test
environment: test
name: mongo-test
namespace: test
spec:
ports:
- name: mongo
port: 27017
clusterIP: None
selector:
service: mongo-test
role: mongo-test
environment: test
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mongo-test
namespace: test
spec:
serviceName: "mongo-test"
replicas: 3
selector:
matchLabels:
service: mongo-test
template:
metadata:
labels:
role: mongo-test
environment: test
service: mongo-test
spec:
serviceAccountName: mongo-test-serviceaccount
terminationGracePeriodSeconds: 60
containers:
- name: mongo
image: mongo:3.6.5
resources:
requests:
cpu: "10m"
command:
- mongod
- "--bind_ip_all"
- "--replSet"
- rs0
- "--smallfiles"
- "--noprealloc"
ports:
- containerPort: 27017
volumeMounts:
- name: mongo-persistent-storage
mountPath: /data/db
- name: mongo-sidecar
image: cvallance/mongo-k8s-sidecar
resources:
requests:
cpu: "10m"
env:
- name: MONGO_SIDECAR_POD_LABELS
value: "role=mongo-test,environment=test"
volumeClaimTemplates:
- metadata:
name: mongo-persistent-storage
annotations:
volumes.beta.kubernetes.io/storage-class: "mongo-ssd"
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 100Gi
最佳答案
至少在 V.1.0.2 之前,istio 不支持有状态集的相互 TLS
关于mongodb - Istio 0.8 中的 Mongo 状态集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50823243/