Skip to content

Commit fdaa7e5

Browse files
authored
Merge pull request #184 from driosalido/affinity_rules
Added antiAffinityRules
2 parents 07b10ba + e76062a commit fdaa7e5

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

.helm_production.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ ingress:
66
globalStaticIpName: bblfsh-play-production
77
hostname: play.bblf.sh
88

9+
affinity:
10+
podAntiAffinity:
11+
requiredDuringSchedulingIgnoredDuringExecution:
12+
- labelSelector:
13+
matchExpressions:
14+
- key: app
15+
operator: In
16+
values:
17+
#This value depends of the HELM_RELEASE defined in .travis.yml should be ${HELM_RELEASE}-${CHART_NAME}
18+
- bblfsh-web-bblfsh-web
19+
topologyKey: kubernetes.io/hostname
20+
921
replicaCount: 2
1022

1123
nodeSelector:

.helm_staging.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ ingress:
88

99
replicaCount: 2
1010

11+
affinity:
12+
podAntiAffinity:
13+
requiredDuringSchedulingIgnoredDuringExecution:
14+
- labelSelector:
15+
matchExpressions:
16+
- key: app
17+
operator: In
18+
values:
19+
#This value depends of the HELM_RELEASE defined in .travis.yml should be ${HELM_RELEASE}-${CHART_NAME}
20+
- bblfsh-web-bblfsh-web
21+
topologyKey: kubernetes.io/hostname
22+
1123
nodeSelector:
1224
cloud.google.com/gke-nodepool: default-pool
1325

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ jobs:
5151
script:
5252
- make packages
5353
- DOCKER_PUSH_MASTER=true make docker-push
54-
- HELM_RELEASE=bblfsh-web HELM_CHART=bblfsh-web K8S_NAMESPACE=default HELM_ARGS="--repo https://src-d.github.io/charts/ --version 0.7.0 --set image.tag=dev-$(git rev-parse --short HEAD)-dirty -f .helm_staging.yml" make deploy
54+
#HELM_RELEASE name is also harcoded in the .helm_staging file in order to use the AntiAffinity Rules.
55+
- HELM_RELEASE=bblfsh-web HELM_CHART=bblfsh-web K8S_NAMESPACE=default HELM_ARGS="--repo https://src-d.github.io/charts/ --version 0.8.0 --set image.tag=dev-$(git rev-parse --short HEAD)-dirty -f .helm_staging.yml" make deploy
5556
- name: 'Deploy to production'
5657
stage: release-helm
5758
script:
58-
- B64_CA_CRT=$B64_CA_CRT_PROD SERVICE_ACCOUNT_TOKEN=$SERVICE_ACCOUNT_TOKEN_PROD CLUSTER_ENDPOINT=$CLUSTER_ENDPOINT_PROD HELM_RELEASE=bblfsh-web HELM_CHART=bblfsh-web K8S_NAMESPACE=default HELM_ARGS="--repo https://src-d.github.io/charts/ --version 0.7.0 --set image.tag=$TRAVIS_TAG -f .helm_production.yml" make deploy
59+
#HELM_RELEASE name is also harcoded in the .helm_production file in order to use the AntiAffinity Rules.
60+
- B64_CA_CRT=$B64_CA_CRT_PROD SERVICE_ACCOUNT_TOKEN=$SERVICE_ACCOUNT_TOKEN_PROD CLUSTER_ENDPOINT=$CLUSTER_ENDPOINT_PROD HELM_RELEASE=bblfsh-web HELM_CHART=bblfsh-web K8S_NAMESPACE=default HELM_ARGS="--repo https://src-d.github.io/charts/ --version 0.8.0 --set image.tag=$TRAVIS_TAG -f .helm_production.yml" make deploy

0 commit comments

Comments
 (0)