-
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.
tests: Add static-client and static-server fixtures for OpenShift
- Loading branch information
Paul Glass
committed
Jul 14, 2023
1 parent
ff5c24b
commit 9e83262
Showing
7 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
acceptance/tests/fixtures/bases/openshift/network-attachment.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,17 @@ | ||
apiVersion: "k8s.cni.cncf.io/v1" | ||
kind: NetworkAttachmentDefinition | ||
metadata: | ||
name: consul-cni | ||
spec: | ||
config: '{ | ||
"cniVersion": "0.3.1", | ||
"type": "consul-cni", | ||
"cni_bin_dir": "/var/lib/cni/bin", | ||
"cni_net_dir": "/etc/kubernetes/cni/net.d", | ||
"kubeconfig": "ZZZ-consul-cni-kubeconfig", | ||
"log_level": "info", | ||
"multus": true, | ||
"name": "consul-cni", | ||
"type": "consul-cni" | ||
}' | ||
|
8 changes: 8 additions & 0 deletions
8
acceptance/tests/fixtures/cases/static-client-openshift-inject/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 |
14 changes: 14 additions & 0 deletions
14
acceptance/tests/fixtures/cases/static-client-openshift-inject/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,14 @@ | ||
# 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:1234" | ||
"k8s.v1.cni.cncf.io/networks": '[{ "name":"consul-cni" }]' |
8 changes: 8 additions & 0 deletions
8
acceptance/tests/fixtures/cases/static-client-openshift-tproxy/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 |
18 changes: 18 additions & 0 deletions
18
acceptance/tests/fixtures/cases/static-client-openshift-tproxy/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,18 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
# When using the CNI on OpenShift, we need to specify the | ||
# network attachment definition for the pods to use. This assumes | ||
# that one named 'consul-cni' was created by the acceptance tests. | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: static-client | ||
spec: | ||
template: | ||
metadata: | ||
annotations: | ||
"consul.hashicorp.com/connect-inject": "true" | ||
"k8s.v1.cni.cncf.io/networks": '[{ "name":"consul-cni" }]' | ||
|
8 changes: 8 additions & 0 deletions
8
acceptance/tests/fixtures/cases/static-server-openshift/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 |
42 changes: 42 additions & 0 deletions
42
acceptance/tests/fixtures/cases/static-server-openshift/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,42 @@ | ||
# 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" | ||
"k8s.v1.cni.cncf.io/networks": '[{ "name":"consul-cni" }]' | ||
spec: | ||
containers: | ||
- name: static-server | ||
image: docker.mirror.hashicorp.services/kschoche/http-echo:latest | ||
args: | ||
- -text="hello world" | ||
- -listen=:8080 | ||
ports: | ||
- containerPort: 8080 | ||
name: http | ||
livenessProbe: | ||
httpGet: | ||
port: 8080 | ||
initialDelaySeconds: 1 | ||
failureThreshold: 1 | ||
periodSeconds: 1 | ||
startupProbe: | ||
httpGet: | ||
port: 8080 | ||
initialDelaySeconds: 1 | ||
failureThreshold: 30 | ||
periodSeconds: 1 | ||
readinessProbe: | ||
exec: | ||
command: ['sh', '-c', 'test ! -f /tmp/unhealthy'] | ||
initialDelaySeconds: 1 | ||
failureThreshold: 1 | ||
periodSeconds: 1 | ||
serviceAccountName: static-server |