Skip to content

Commit

Permalink
fix(bug): improve probe and add node affinity (#7)
Browse files Browse the repository at this point in the history
* feat(local-volume): improve probe and add add local volume

* chore(*): fix volume mode and remove pod affinity

* chore(liveness): adjust periodSeconds and failureThreshold
  • Loading branch information
bbbmj authored and caicloud-bot committed Apr 3, 2019
1 parent 8aa9d76 commit 76b739f
Showing 1 changed file with 41 additions and 18 deletions.
59 changes: 41 additions & 18 deletions release/infra-mongo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,41 @@ _config:
template:
type: template.caicloud.io/application
version: 1.0.0
version: "v0.0.4"
version: "v0.0.5"
controllers:
- containers:
- name: mongo
image: '[[ registry_library ]]/mongo:3.6.5'
imagePullPolicy: IfNotPresent
probe:
liveness:
handler:
type: EXEC
method:
command:
- mongo
- --eval
- "db.adminCommand('ping')"
threshold:
success: 1
failure: 3
delay: 15
period: 20
failure: 40
delay: 30
period: 15
timeout: 5
readiness:
handler:
type: TCP
type: EXEC
method:
port: 27017
timeout: 1
imagePullPolicy: IfNotPresent
command:
- mongo
- --eval
- "db.adminCommand('ping')"
threshold:
success: 1
failure: 6
delay: 5
period: 10
timeout: 5
args:
- mongod
- "--replSet"
Expand All @@ -48,22 +65,28 @@ _config:
- name: KUBERNETES_MONGO_SERVICE_NAME
value: mgo-cluster
schedule:
antiaffinity:
pod:
terms:
- selector:
labels:
k8s-app: mongo
topologyKey: kubernetes.io/hostname
type: Required
# Remove pod antiaffinity as we use local volume with node affinity.
# antiaffinity:
# pod:
# terms:
# - selector:
# labels:
# k8s-app: mongo
# topologyKey: kubernetes.io/hostname
# type: Required
labels:
k8s-app: mongo
controller:
replica: 3
domain: mgo-cluster
pod:
priorityClassName: system-cluster-critical
type: StatefulSet
volumes:
- name: mongo-storage
source:
path: /var/lib/compass/db/mongo
type: HostPath
modes:
- ReadWriteOnce
type: Dedicated
storage:
request: 50Gi

0 comments on commit 76b739f

Please sign in to comment.