-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #361 from olliewalsh/tls_change
Force recreation of ovs db cluster on first replica when protocol changes
- Loading branch information
Showing
18 changed files
with
190 additions
and
29 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../common/assert_tls_certs.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 @@ | ||
../../common/tls_ca_bundle.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 @@ | ||
../../common/tls_certs.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,39 @@ | ||
apiVersion: ovn.openstack.org/v1beta1 | ||
kind: OVNDBCluster | ||
metadata: | ||
name: ovndbcluster-nb-sample | ||
spec: | ||
replicas: 3 | ||
status: | ||
readyCount: 3 | ||
--- | ||
apiVersion: ovn.openstack.org/v1beta1 | ||
kind: OVNDBCluster | ||
metadata: | ||
name: ovndbcluster-sb-sample | ||
spec: | ||
replicas: 3 | ||
status: | ||
readyCount: 3 | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
commands: | ||
# check the DB uri scheme is tcp | ||
- script: | | ||
template='{{.status.internalDbAddress}}{{"\n"}}' | ||
regex="tcp:.*" | ||
dbUri=$(oc get -n $NAMESPACE OVNDBCluster ovndbcluster-sb-sample -o go-template="$template") | ||
matches=$(echo "$dbUri" | sed -e "s?$regex??") | ||
if [[ -n "$matches" ]]; then | ||
exit 1 | ||
fi | ||
# Check ovn connect is ptcp | ||
- script: | | ||
sb_pod=$(oc get pod -n $NAMESPACE -l service=ovsdbserver-sb -o name|head -1) | ||
oc rsh -n $NAMESPACE ${sb_pod} ovn-sbctl --no-leader-only get-connection | grep -q ptcp | ||
# Check we have 3 servers using tcp | ||
- script: | | ||
$OVN_KUTTL_DIR/../common/scripts/check_cluster_status.sh nb 3 | ||
- script: | | ||
$OVN_KUTTL_DIR/../common/scripts/check_cluster_status.sh sb 3 |
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: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: | | ||
cp ../../../../config/samples/ovn_* deploy/ | ||
oc kustomize deploy | oc apply -n $NAMESPACE -f - |
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,39 @@ | ||
apiVersion: ovn.openstack.org/v1beta1 | ||
kind: OVNDBCluster | ||
metadata: | ||
name: ovndbcluster-nb-sample | ||
spec: | ||
replicas: 3 | ||
status: | ||
readyCount: 3 | ||
--- | ||
apiVersion: ovn.openstack.org/v1beta1 | ||
kind: OVNDBCluster | ||
metadata: | ||
name: ovndbcluster-sb-sample | ||
spec: | ||
replicas: 3 | ||
status: | ||
readyCount: 3 | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
commands: | ||
# check the DB uri scheme is ssl | ||
- script: | | ||
template='{{.status.internalDbAddress}}{{"\n"}}' | ||
regex="ssl:.*" | ||
dbUri=$(oc get -n $NAMESPACE OVNDBCluster ovndbcluster-sb-sample -o go-template="$template") | ||
matches=$(echo "$dbUri" | sed -e "s?$regex??") | ||
if [[ -n "$matches" ]]; then | ||
exit 1 | ||
fi | ||
# Check ovn connect is pssl | ||
- script: | | ||
sb_pod=$(oc get pod -n $NAMESPACE -l service=ovsdbserver-sb -o name|head -1) | ||
oc rsh -n $NAMESPACE ${sb_pod} ovn-sbctl --no-leader-only get-connection | grep -q pssl | ||
# Check we have 3 servers using ssl | ||
- script: | | ||
$OVN_KUTTL_DIR/../common/scripts/check_cluster_status.sh nb 3 ssl | ||
- script: | | ||
$OVN_KUTTL_DIR/../common/scripts/check_cluster_status.sh sb 3 ssl |
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: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: | | ||
cp ../../../../config/samples/ovn_* enable_tls/ | ||
oc kustomize enable_tls | oc apply -n $NAMESPACE -f - |
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 @@ | ||
../../common/cleanup-ovn.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 @@ | ||
../../common/errors_cleanup_ovn.yaml |
11 changes: 11 additions & 0 deletions
11
tests/kuttl/tests/ovn_tls_enable/deploy/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,11 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ovn_v1beta1_ovndbcluster.yaml | ||
patches: | ||
- patch: |- | ||
- op: add | ||
path: /spec/replicas | ||
value: 3 | ||
target: | ||
kind: OVNDBCluster |
47 changes: 47 additions & 0 deletions
47
tests/kuttl/tests/ovn_tls_enable/enable_tls/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,47 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ovn_v1beta1_ovnnorthd.yaml | ||
- ovn_v1beta1_ovndbcluster.yaml | ||
- ovn_v1beta1_ovncontroller.yaml | ||
patches: | ||
- patch: |- | ||
- op: add | ||
path: /spec/replicas | ||
value: 3 | ||
target: | ||
kind: OVNDBCluster | ||
- patch: |- | ||
- op: add | ||
path: /spec/tls | ||
value: | ||
caBundleSecretName: combined-ca-bundle | ||
secretName: cert-ovsdbserver-nb-svc | ||
target: | ||
kind: OVNDBCluster | ||
name: ovndbcluster-nb-sample | ||
- patch: |- | ||
- op: add | ||
path: /spec/tls | ||
value: | ||
caBundleSecretName: combined-ca-bundle | ||
secretName: cert-ovsdbserver-sb-svc | ||
target: | ||
kind: OVNDBCluster | ||
name: ovndbcluster-sb-sample | ||
- patch: |- | ||
- op: add | ||
path: /spec/tls | ||
value: | ||
caBundleSecretName: combined-ca-bundle | ||
secretName: cert-ovnnorthd-svc | ||
target: | ||
kind: OVNNorthd | ||
- patch: |- | ||
- op: add | ||
path: /spec/tls | ||
value: | ||
caBundleSecretName: combined-ca-bundle | ||
secretName: cert-ovncontroller-svc | ||
target: | ||
kind: OVNController |