-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mw/net 4260 phase 2 automate the k8s sameness tests (#2579)
* add kustomize files - These reflect the different test cases - sameness.yaml defines the ordered list of failovers - static-server responds with a unique name so we can track failover order - static-client includes both DNS and CURL in the image used so we can exec in for testing * add sameness tests - We do a bunch of infra setup for peering and partitions, but after the initial setup only partitions are tested - We test service failover, dns failover and PQ failover scenarios * add 4 kind clusters to make target - The sameness tests require 4 kind clusters, so the make target will now spin up 4 kind clusters - not all tests need 4 kind clusters, but the entire suite of tests can be run with 4 * increase kubectl timeout to 90s - add variable for configuring timeout - timeout was triggering locally on intel mac machine, so this timeout should cover our devs lowest performing machines * add sameness test to test packages * Fix comments on partition connect test
- Loading branch information
1 parent
2d9ed11
commit 963ec02
Showing
28 changed files
with
764 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
acceptance/tests/fixtures/bases/sameness/default-ns/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
resources: | ||
- sameness.yaml |
12 changes: 12 additions & 0 deletions
12
acceptance/tests/fixtures/bases/sameness/default-ns/sameness.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: consul.hashicorp.com/v1alpha1 | ||
kind: SamenessGroup | ||
metadata: | ||
name: mine | ||
spec: | ||
members: | ||
- partition: default | ||
- partition: ap1 | ||
- peer: cluster-01-a | ||
- peer: cluster-01-b | ||
- peer: cluster-02-a | ||
- peer: cluster-03-a |
9 changes: 9 additions & 0 deletions
9
acceptance/tests/fixtures/bases/sameness/exportedservices-ap1/exportedservices-ap1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
apiVersion: consul.hashicorp.com/v1alpha1 | ||
kind: ExportedServices | ||
metadata: | ||
name: ap1 | ||
spec: | ||
services: [] |
5 changes: 5 additions & 0 deletions
5
acceptance/tests/fixtures/bases/sameness/exportedservices-ap1/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
resources: | ||
- exportedservices-ap1.yaml |
12 changes: 12 additions & 0 deletions
12
acceptance/tests/fixtures/bases/sameness/override-ns/intentions.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: consul.hashicorp.com/v1alpha1 | ||
kind: ServiceIntentions | ||
metadata: | ||
name: static-server | ||
spec: | ||
destination: | ||
name: static-server | ||
sources: | ||
- name: static-client | ||
namespace: ns1 | ||
samenessGroup: mine | ||
action: allow |
7 changes: 7 additions & 0 deletions
7
acceptance/tests/fixtures/bases/sameness/override-ns/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
resources: | ||
- intentions.yaml | ||
- payment-service-resolver.yaml | ||
- service-defaults.yaml |
13 changes: 13 additions & 0 deletions
13
acceptance/tests/fixtures/bases/sameness/override-ns/payment-service-resolver.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: consul.hashicorp.com/v1alpha1 | ||
kind: ServiceResolver | ||
metadata: | ||
name: static-server | ||
spec: | ||
connectTimeout: 15s | ||
failover: | ||
'*': | ||
samenessGroup: mine | ||
policy: | ||
mode: order-by-locality | ||
regions: | ||
- us-west-2 |
6 changes: 6 additions & 0 deletions
6
acceptance/tests/fixtures/bases/sameness/override-ns/service-defaults.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: consul.hashicorp.com/v1alpha1 | ||
kind: ServiceDefaults | ||
metadata: | ||
name: static-server | ||
spec: | ||
protocol: http |
5 changes: 5 additions & 0 deletions
5
acceptance/tests/fixtures/bases/sameness/peering/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
resources: | ||
- mesh.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: consul.hashicorp.com/v1alpha1 | ||
kind: Mesh | ||
metadata: | ||
name: mesh | ||
spec: | ||
peering: | ||
peerThroughMeshGateways: true |
8 changes: 8 additions & 0 deletions
8
acceptance/tests/fixtures/cases/sameness/exported-services/ap1-partition/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
resources: | ||
- ../../../../bases/sameness/exportedservices-ap1 | ||
|
||
patchesStrategicMerge: | ||
- patch.yaml |
16 changes: 16 additions & 0 deletions
16
acceptance/tests/fixtures/cases/sameness/exported-services/ap1-partition/patch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
apiVersion: consul.hashicorp.com/v1alpha1 | ||
kind: ExportedServices | ||
metadata: | ||
name: ap1 | ||
spec: | ||
services: | ||
- name: static-server | ||
namespace: ns2 | ||
consumers: | ||
- samenessGroup: mine | ||
- name: mesh-gateway | ||
consumers: | ||
- samenessGroup: mine |
8 changes: 8 additions & 0 deletions
8
...ance/tests/fixtures/cases/sameness/exported-services/default-partition/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
resources: | ||
- ../../../../bases/exportedservices-default | ||
|
||
patchesStrategicMerge: | ||
- patch.yaml |
16 changes: 16 additions & 0 deletions
16
acceptance/tests/fixtures/cases/sameness/exported-services/default-partition/patch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
apiVersion: consul.hashicorp.com/v1alpha1 | ||
kind: ExportedServices | ||
metadata: | ||
name: default | ||
spec: | ||
services: | ||
- name: static-server | ||
namespace: ns2 | ||
consumers: | ||
- samenessGroup: mine | ||
- name: mesh-gateway | ||
consumers: | ||
- samenessGroup: mine |
8 changes: 8 additions & 0 deletions
8
acceptance/tests/fixtures/cases/sameness/static-client/default/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
resources: | ||
- ../../../../bases/static-client | ||
|
||
patchesStrategicMerge: | ||
- patch.yaml |
22 changes: 22 additions & 0 deletions
22
acceptance/tests/fixtures/cases/sameness/static-client/default/patch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: static-client | ||
spec: | ||
template: | ||
metadata: | ||
annotations: | ||
'consul.hashicorp.com/connect-inject': 'true' | ||
'consul.hashicorp.com/connect-service-upstreams': 'static-server.ns2.default:8080' | ||
spec: | ||
containers: | ||
- name: static-client | ||
image: anubhavmishra/tiny-tools:latest | ||
# Just spin & wait forever, we'll use `kubectl exec` to demo | ||
command: ['/bin/sh', '-c', '--'] | ||
args: ['while true; do sleep 30; done;'] | ||
# If ACLs are enabled, the serviceAccountName must match the Consul service name. | ||
serviceAccountName: static-client |
8 changes: 8 additions & 0 deletions
8
acceptance/tests/fixtures/cases/sameness/static-client/partition/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
resources: | ||
- ../../../../bases/static-client | ||
|
||
patchesStrategicMerge: | ||
- patch.yaml |
22 changes: 22 additions & 0 deletions
22
acceptance/tests/fixtures/cases/sameness/static-client/partition/patch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: static-client | ||
spec: | ||
template: | ||
metadata: | ||
annotations: | ||
'consul.hashicorp.com/connect-inject': 'true' | ||
'consul.hashicorp.com/connect-service-upstreams': 'static-server.ns2.ap1:8080' | ||
spec: | ||
containers: | ||
- name: static-client | ||
image: anubhavmishra/tiny-tools:latest | ||
# Just spin & wait forever, we'll use `kubectl exec` to demo | ||
command: ['/bin/sh', '-c', '--'] | ||
args: ['while true; do sleep 30; done;'] | ||
# If ACLs are enabled, the serviceAccountName must match the Consul service name. | ||
serviceAccountName: static-client |
8 changes: 8 additions & 0 deletions
8
acceptance/tests/fixtures/cases/sameness/static-server/default/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
resources: | ||
- ../../../../bases/static-server | ||
|
||
patchesStrategicMerge: | ||
- patch.yaml |
23 changes: 23 additions & 0 deletions
23
acceptance/tests/fixtures/cases/sameness/static-server/default/patch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: static-server | ||
spec: | ||
template: | ||
metadata: | ||
annotations: | ||
"consul.hashicorp.com/connect-inject": "true" | ||
spec: | ||
containers: | ||
- name: static-server | ||
image: docker.mirror.hashicorp.services/hashicorp/http-echo:alpine | ||
args: | ||
- -text="cluster-01-a" | ||
- -listen=:8080 | ||
ports: | ||
- containerPort: 8080 | ||
name: http | ||
serviceAccountName: static-server |
8 changes: 8 additions & 0 deletions
8
acceptance/tests/fixtures/cases/sameness/static-server/partition/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
resources: | ||
- ../../../../bases/static-server | ||
|
||
patchesStrategicMerge: | ||
- patch.yaml |
23 changes: 23 additions & 0 deletions
23
acceptance/tests/fixtures/cases/sameness/static-server/partition/patch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: static-server | ||
spec: | ||
template: | ||
metadata: | ||
annotations: | ||
"consul.hashicorp.com/connect-inject": "true" | ||
spec: | ||
containers: | ||
- name: static-server | ||
image: docker.mirror.hashicorp.services/hashicorp/http-echo:alpine | ||
args: | ||
- -text="cluster-01-b" | ||
- -listen=:8080 | ||
ports: | ||
- containerPort: 8080 | ||
name: http | ||
serviceAccountName: static-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.