Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gateway anti-affinity and replicas #1702

Merged
merged 1 commit into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charts/consul/test/unit/connect-inject-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -1496,15 +1496,15 @@ load _helpers
#--------------------------------------------------------------------
# replicas

@test "connectInject/Deployment: replicas defaults to 2" {
@test "connectInject/Deployment: replicas defaults to 1" {
cd `chart_dir`
local actual=$(helm template \
-s templates/connect-inject-deployment.yaml \
--set 'connectInject.enabled=true' \
. | tee /dev/stderr |
yq '.spec.replicas' | tee /dev/stderr)

[ "${actual}" = "2" ]
[ "${actual}" = "1" ]
}

@test "connectInject/Deployment: replicas can be set" {
Expand Down
10 changes: 5 additions & 5 deletions charts/consul/test/unit/ingress-gateways-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -365,15 +365,15 @@ load _helpers
#--------------------------------------------------------------------
# replicas

@test "ingressGateways/Deployment: replicas defaults to 2" {
@test "ingressGateways/Deployment: replicas defaults to 1" {
cd `chart_dir`
local actual=$(helm template \
-s templates/ingress-gateways-deployment.yaml \
--set 'ingressGateways.enabled=true' \
--set 'connectInject.enabled=true' \
. | tee /dev/stderr |
yq -s -r '.[0].spec.replicas' | tee /dev/stderr)
[ "${actual}" = "2" ]
[ "${actual}" = "1" ]
}

@test "ingressGateways/Deployment: replicas can be set through defaults" {
Expand Down Expand Up @@ -590,15 +590,15 @@ load _helpers
#--------------------------------------------------------------------
# affinity

@test "ingressGateways/Deployment: affinity defaults to one per node" {
@test "ingressGateways/Deployment: affinity defaults to null" {
cd `chart_dir`
local actual=$(helm template \
-s templates/ingress-gateways-deployment.yaml \
--set 'ingressGateways.enabled=true' \
--set 'connectInject.enabled=true' \
. | tee /dev/stderr |
yq -s -r '.[0].spec.template.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].topologyKey' | tee /dev/stderr)
[ "${actual}" = "kubernetes.io/hostname" ]
yq -s -r '.[0].spec.template.spec.affinity' | tee /dev/stderr)
[ "${actual}" = "null" ]
}

@test "ingressGateways/Deployment: affinity can be set through defaults" {
Expand Down
10 changes: 5 additions & 5 deletions charts/consul/test/unit/mesh-gateway-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ key2: value2' \
#--------------------------------------------------------------------
# replicas

@test "meshGateway/Deployment: replicas defaults to 2" {
@test "meshGateway/Deployment: replicas defaults to 1" {
cd `chart_dir`
local actual=$(helm template \
-s templates/mesh-gateway-deployment.yaml \
--set 'meshGateway.enabled=true' \
--set 'connectInject.enabled=true' \
. | tee /dev/stderr |
yq -r '.spec.replicas' | tee /dev/stderr)
[ "${actual}" = "2" ]
[ "${actual}" = "1" ]
}

@test "meshGateway/Deployment: replicas can be overridden" {
Expand All @@ -190,15 +190,15 @@ key2: value2' \
#--------------------------------------------------------------------
# affinity

@test "meshGateway/Deployment: affinity defaults to one per node" {
@test "meshGateway/Deployment: affinity defaults to null" {
cd `chart_dir`
local actual=$(helm template \
-s templates/mesh-gateway-deployment.yaml \
--set 'meshGateway.enabled=true' \
--set 'connectInject.enabled=true' \
. | tee /dev/stderr |
yq -r '.spec.template.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].topologyKey' | tee /dev/stderr)
[ "${actual}" = "kubernetes.io/hostname" ]
yq -r '.spec.template.spec.affinity' | tee /dev/stderr)
[ "${actual}" = "null" ]
}

@test "meshGateway/Deployment: affinity can be overridden" {
Expand Down
10 changes: 5 additions & 5 deletions charts/consul/test/unit/terminating-gateways-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -403,15 +403,15 @@ load _helpers
#--------------------------------------------------------------------
# replicas

@test "terminatingGateways/Deployment: replicas defaults to 2" {
@test "terminatingGateways/Deployment: replicas defaults to 1" {
cd `chart_dir`
local actual=$(helm template \
-s templates/terminating-gateways-deployment.yaml \
--set 'terminatingGateways.enabled=true' \
--set 'connectInject.enabled=true' \
. | tee /dev/stderr |
yq -s -r '.[0].spec.replicas' | tee /dev/stderr)
[ "${actual}" = "2" ]
[ "${actual}" = "1" ]
}

@test "terminatingGateways/Deployment: replicas can be set through defaults" {
Expand Down Expand Up @@ -663,15 +663,15 @@ load _helpers
#--------------------------------------------------------------------
# affinity

@test "terminatingGateways/Deployment: affinity defaults to one per node" {
@test "terminatingGateways/Deployment: affinity defaults to null" {
cd `chart_dir`
local actual=$(helm template \
-s templates/terminating-gateways-deployment.yaml \
--set 'terminatingGateways.enabled=true' \
--set 'connectInject.enabled=true' \
. | tee /dev/stderr |
yq -s -r '.[0].spec.template.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].topologyKey' | tee /dev/stderr)
[ "${actual}" = "kubernetes.io/hostname" ]
yq -s -r '.[0].spec.template.spec.affinity' | tee /dev/stderr)
[ "${actual}" = "null" ]
}

@test "terminatingGateways/Deployment: affinity can be set through defaults" {
Expand Down
Loading