From 8ed26962fa86392363114dc80cf89257a19cd7d6 Mon Sep 17 00:00:00 2001 From: NSMBot <nsmbot@networkservicmesh.io> Date: Tue, 16 Aug 2022 11:15:43 +0000 Subject: [PATCH] Update go.mod and go.sum to latest version from networkservicemesh/deployments-k8s@main PR link: https://github.com/networkservicemesh/deployments-k8s/pull/7071 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit: 8b04b07 Author: Network Service Mesh Bot Date: 2022-08-15 05:50:00 -0500 Message: - Update go.mod and go.sum to latest version from networkservicemesh/de… Signed-off-by: NSMBot <nsmbot@networkservicmesh.io> --- extensions/base/suite.go | 2 +- suites/basic/suite.gen.go | 50 +++++----- suites/features/suite.gen.go | 78 +++++++-------- .../floating_interdomain/spire/suite.gen.go | 6 +- suites/floating_interdomain/suite.gen.go | 42 ++++---- suites/heal/suite.gen.go | 98 +++++++++---------- suites/interdomain/nsm/suite.gen.go | 4 +- .../nsm_istio_booking/suite.gen.go | 8 +- suites/interdomain/spire/suite.gen.go | 2 +- suites/interdomain/suite.gen.go | 28 +++--- .../external_nsc/docker/suite.gen.go | 2 +- .../external_nsc/spire/suite.gen.go | 2 +- suites/k8s_monolith/external_nsc/suite.gen.go | 6 +- .../external_nse/docker/suite.gen.go | 2 +- .../external_nse/spire/suite.gen.go | 2 +- suites/k8s_monolith/external_nse/suite.gen.go | 6 +- suites/memory/suite.gen.go | 14 +-- suites/multiforwarder/suite.gen.go | 30 +++--- suites/observability/suite.gen.go | 8 +- suites/ovs/suite.gen.go | 18 ++-- suites/remotevlan/rvlanovs/suite.gen.go | 12 +-- suites/remotevlan/rvlanvpp/suite.gen.go | 12 +-- suites/spire/suite.gen.go | 2 +- suites/sriov/suite.gen.go | 10 +- 24 files changed, 222 insertions(+), 222 deletions(-) diff --git a/extensions/base/suite.go b/extensions/base/suite.go index 11b03fad3d..1a4a250fbd 100644 --- a/extensions/base/suite.go +++ b/extensions/base/suite.go @@ -52,7 +52,7 @@ func (s *Suite) TearDownSuite() { } const ( - sha = "e227cb77a6b89fae46efee1bff053f3f7a5e25ba" + sha = "78540a6797a9e83149d886f982d1afd96e53df65" ) // SetupSuite runs all extensions diff --git a/suites/basic/suite.gen.go b/suites/basic/suite.gen.go index 9c0145c083..7c01a97134 100755 --- a/suites/basic/suite.gen.go +++ b/suites/basic/suite.gen.go @@ -28,7 +28,7 @@ func (s *Suite) SetupSuite() { r.Run(`WH=$(kubectl get pods -l app=admission-webhook-k8s -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `kubectl delete mutatingwebhookconfiguration ${WH}` + "\n" + `kubectl delete ns nsm-system`) }) r.Run(`kubectl create ns nsm-system`) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/basic?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/basic?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`WH=$(kubectl get pods -l app=admission-webhook-k8s -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `kubectl wait --for=condition=ready --timeout=1m pod ${WH} -n nsm-system`) } func (s *Suite) TestKernel2Kernel() { @@ -36,9 +36,9 @@ func (s *Suite) TestKernel2Kernel() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: alpine` + "\n" + ` labels:` + "\n" + ` app: alpine ` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://icmp-responder/nsm-1` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -54,9 +54,9 @@ func (s *Suite) TestKernel2Memif() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: alpine` + "\n" + ` labels:` + "\n" + ` app: alpine ` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://icmp-responder/nsm-1` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -72,9 +72,9 @@ func (s *Suite) TestKernel2Vxlan2Kernel() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: alpine` + "\n" + ` labels:` + "\n" + ` app: alpine ` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://icmp-responder/nsm-1` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -90,9 +90,9 @@ func (s *Suite) TestKernel2Vxlan2Memif() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: alpine` + "\n" + ` labels:` + "\n" + ` app: alpine ` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://icmp-responder/nsm-1` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -108,9 +108,9 @@ func (s *Suite) TestKernel2Wireguard2Kernel() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: alpine` + "\n" + ` labels:` + "\n" + ` app: alpine ` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://icmp-responder-ip/nsm-1` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` - name: NSM_PAYLOAD` + "\n" + ` value: IP` + "\n" + ` - name: NSM_SERVICE_NAMES` + "\n" + ` value: icmp-responder-ip` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -126,9 +126,9 @@ func (s *Suite) TestKernel2Wireguard2Memif() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: alpine` + "\n" + ` labels:` + "\n" + ` app: alpine ` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://icmp-responder-ip/nsm-1` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` - name: NSM_PAYLOAD` + "\n" + ` value: IP` + "\n" + ` - name: NSM_SERVICE_NAMES` + "\n" + ` value: icmp-responder-ip` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -144,9 +144,9 @@ func (s *Suite) TestMemif2Kernel() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: memif://icmp-responder/nsm-1` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -162,9 +162,9 @@ func (s *Suite) TestMemif2Memif() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: memif://icmp-responder/nsm-1` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -180,9 +180,9 @@ func (s *Suite) TestMemif2Vxlan2Kernel() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: memif://icmp-responder/nsm-1` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -198,9 +198,9 @@ func (s *Suite) TestMemif2Vxlan2Memif() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: memif://icmp-responder/nsm-1` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -216,9 +216,9 @@ func (s *Suite) TestMemif2Wireguard2Kernel() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: memif://icmp-responder-ip/nsm-1` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` - name: NSM_PAYLOAD` + "\n" + ` value: IP` + "\n" + ` - name: NSM_SERVICE_NAMES` + "\n" + ` value: icmp-responder-ip` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -234,9 +234,9 @@ func (s *Suite) TestMemif2Wireguard2Memif() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: memif://icmp-responder-ip/nsm-1` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` - name: NSM_PAYLOAD` + "\n" + ` value: IP` + "\n" + ` - name: NSM_SERVICE_NAMES` + "\n" + ` value: icmp-responder-ip` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) diff --git a/suites/features/suite.gen.go b/suites/features/suite.gen.go index 8a3ae4a027..62fa60f314 100755 --- a/suites/features/suite.gen.go +++ b/suites/features/suite.gen.go @@ -29,11 +29,11 @@ func (s *Suite) TestDns() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) r.Run(`cat > dnsutils.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: dnsutils` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://my-coredns-service/nsm-1` + "\n" + ` labels:` + "\n" + ` app: dnsutils` + "\n" + ` "spiffe.io/spiffe-id": "true"` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: dnsutils` + "\n" + ` image: k8s.gcr.io/e2e-test-images/jessie-dnsutils:1.3` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_SERVICE_NAMES` + "\n" + ` value: my-coredns-service` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` - name: NSM_DNS_CONFIGS` + "\n" + ` value: "[{\"dns_server_ips\": [\"172.16.1.100\"], \"search_domains\": [\"my.coredns.service\"]}]"` + "\n" + ` - name: coredns` + "\n" + ` image: coredns/coredns:1.8.3` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` resources:` + "\n" + ` limits:` + "\n" + ` memory: 170Mi` + "\n" + ` requests:` + "\n" + ` cpu: 100m` + "\n" + ` memory: 70Mi` + "\n" + ` args: [ "-conf", "/etc/coredns/Corefile" ]` + "\n" + ` volumeMounts:` + "\n" + ` - name: config-volume` + "\n" + ` mountPath: /etc/coredns` + "\n" + ` readOnly: true` + "\n" + ` ports:` + "\n" + ` - containerPort: 53` + "\n" + ` name: dns` + "\n" + ` protocol: UDP` + "\n" + ` - containerPort: 53` + "\n" + ` name: dns-tcp` + "\n" + ` protocol: TCP` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + ` volumes:` + "\n" + ` - name: config-volume` + "\n" + ` configMap:` + "\n" + ` name: coredns` + "\n" + ` items:` + "\n" + ` - key: Corefile` + "\n" + ` path: Corefile` + "\n" + `EOF`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `resources:` + "\n" + `- dnsutils.yaml` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/dns/coredns-config-map.yaml` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `resources:` + "\n" + `- dnsutils.yaml` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/dns/coredns-config-map.yaml` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) r.Run(`kubectl wait --for=condition=ready --timeout=5m pod dnsutils -n ${NAMESPACE}`) r.Run(`kubectl wait --for=condition=ready --timeout=5m pod -l app=nse-kernel -n ${NAMESPACE}`) @@ -48,9 +48,9 @@ func (s *Suite) TestKernel2Kernel_dual_stack() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources:` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources:` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: alpine` + "\n" + ` labels:` + "\n" + ` app: alpine` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://icmp-responder/nsm-1` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31,2001:db8::/116` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -68,9 +68,9 @@ func (s *Suite) TestKernel2Wireguard2Kernel_dual_stack() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources:` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources:` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: alpine` + "\n" + ` labels:` + "\n" + ` app: alpine` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://icmp-responder-ip/nsm-1` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31,2001:db8::/116` + "\n" + ` - name: NSM_PAYLOAD` + "\n" + ` value: IP` + "\n" + ` - name: NSM_SERVICE_NAMES` + "\n" + ` value: icmp-responder-ip` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -88,9 +88,9 @@ func (s *Suite) TestExclude_prefixes() { s.T().Cleanup(func() { r.Run(`kubectl delete configmap excluded-prefixes-config` + "\n" + `kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/30` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -f exclude-prefixes-config-map.yaml`) @@ -107,8 +107,8 @@ func (s *Suite) TestExclude_prefixes_client() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources:` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/exclude-prefixes-client/test-client.yaml` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/exclude-prefixes-client/nsm-service-1.yaml` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/exclude-prefixes-client/nsm-service-2.yaml` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/exclude-prefixes-client/nse-kernel-1.yaml` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/exclude-prefixes-client/nse-kernel-2.yaml` + "\n" + `EOF`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources:` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/exclude-prefixes-client/test-client.yaml` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/exclude-prefixes-client/nsm-service-1.yaml` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/exclude-prefixes-client/nsm-service-2.yaml` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/exclude-prefixes-client/nse-kernel-1.yaml` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/exclude-prefixes-client/nse-kernel-2.yaml` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) r.Run(`kubectl wait --for=condition=ready --timeout=1m pod -l app=alpine -n ${NAMESPACE}`) r.Run(`kubectl wait --for=condition=ready --timeout=1m pod -l app=nse-kernel-1 -n ${NAMESPACE}`) @@ -126,9 +126,9 @@ func (s *Suite) TestKernel2Kernel_ipv6() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: alpine` + "\n" + ` labels:` + "\n" + ` app: alpine ` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://icmp-responder/nsm-1` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 2001:db8::/116` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -144,9 +144,9 @@ func (s *Suite) TestKernel2Wireguard2Kernel_ipv6() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: alpine` + "\n" + ` labels:` + "\n" + ` app: alpine ` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://icmp-responder-ip/nsm-1` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 2001:db8::/116` + "\n" + ` - name: NSM_PAYLOAD` + "\n" + ` value: IP` + "\n" + ` - name: NSM_SERVICE_NAMES` + "\n" + ` value: icmp-responder-ip` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -162,9 +162,9 @@ func (s *Suite) TestKernel2Wireguard2Memif_ipv6() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: alpine` + "\n" + ` labels:` + "\n" + ` app: alpine ` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://icmp-responder-ip/nsm-1` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 2001:db8::/116` + "\n" + ` - name: NSM_PAYLOAD` + "\n" + ` value: IP` + "\n" + ` - name: NSM_SERVICE_NAMES` + "\n" + ` value: icmp-responder-ip` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -180,9 +180,9 @@ func (s *Suite) TestMemif2Memif_ipv6() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: memif://icmp-responder/nsm-1` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 2001:db8::/116` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -198,9 +198,9 @@ func (s *Suite) TestMemif2Wireguard2Kernel_ipv6() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: memif://icmp-responder-ip/nsm-1` + "\n" + `` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 2001:db8::/116` + "\n" + ` - name: NSM_PAYLOAD` + "\n" + ` value: IP` + "\n" + ` - name: NSM_SERVICE_NAMES` + "\n" + ` value: icmp-responder-ip` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -216,9 +216,9 @@ func (s *Suite) TestMemif2Wireguard2Memif_ipv6() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: memif://icmp-responder-ip/nsm-1` + "\n" + `` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 2001:db8::/116` + "\n" + ` - name: NSM_PAYLOAD` + "\n" + ` value: IP` + "\n" + ` - name: NSM_SERVICE_NAMES` + "\n" + ` value: icmp-responder-ip` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -234,9 +234,9 @@ func (s *Suite) TestMutually_aware_nses() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources:` + "\n" + `- nse-1.yaml` + "\n" + `- nse-2.yaml` + "\n" + `- config-file-nse-1.yaml` + "\n" + `- config-file-nse-2.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources:` + "\n" + `- nse-1.yaml` + "\n" + `- nse-2.yaml` + "\n" + `- config-file-nse-1.yaml` + "\n" + `- config-file-nse-2.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder-1/nsm-1?color=red,kernel://icmp-responder-2/nsm-2?color=red` + "\n" + ` - name: NSM_AWARENESS_GROUPS` + "\n" + ` value: "[kernel://icmp-responder-1/nsm-1?color=red,kernel://icmp-responder-2/nsm-2?color=red]"` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) r.Run(`kubectl wait --for=condition=ready --timeout=1m pod -l app=nsc-kernel -n ${NAMESPACE}`) @@ -252,9 +252,9 @@ func (s *Suite) TestNse_composition() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources:` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/nse-composition/config-file.yaml` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/nse-composition/passthrough-1.yaml` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/nse-composition/passthrough-2.yaml` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/nse-composition/passthrough-3.yaml` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/nse-composition/nse-composition-ns.yaml` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/examples/features/nse-composition/nse-firewall?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `` + "\n" + `configMapGenerator:` + "\n" + ` - name: nginx-config` + "\n" + ` files:` + "\n" + ` - https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/nse-composition/nginx.conf` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources:` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/nse-composition/config-file.yaml` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/nse-composition/passthrough-1.yaml` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/nse-composition/passthrough-2.yaml` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/nse-composition/passthrough-3.yaml` + "\n" + `- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/nse-composition/nse-composition-ns.yaml` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/examples/features/nse-composition/nse-firewall?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `` + "\n" + `configMapGenerator:` + "\n" + ` - name: nginx-config` + "\n" + ` files:` + "\n" + ` - https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/nse-composition/nginx.conf` + "\n" + `EOF`) r.Run(`cat > client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: alpine` + "\n" + ` labels:` + "\n" + ` app: alpine ` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://nse-composition/nsm-1` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` - name: NSM_SERVICE_NAMES` + "\n" + ` value: "nse-composition"` + "\n" + ` - name: NSM_REGISTER_SERVICE` + "\n" + ` value: "false"` + "\n" + ` - name: NSM_LABELS` + "\n" + ` value: "app:gateway"` + "\n" + ` - name: nginx` + "\n" + ` image: nginx` + "\n" + ` ports:` + "\n" + ` - containerPort: 80` + "\n" + ` - containerPort: 8080` + "\n" + ` volumeMounts:` + "\n" + ` - name: nginx-config` + "\n" + ` mountPath: /etc/nginx/nginx.conf` + "\n" + ` subPath: nginx.conf` + "\n" + ` readOnly: true` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` nodeName: ${NODE}` + "\n" + ` volumes:` + "\n" + ` - name: nginx-config` + "\n" + ` configMap:` + "\n" + ` name: nginx-config` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -272,9 +272,9 @@ func (s *Suite) TestOpa() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_MAX_TOKEN_LIFETIME` + "\n" + ` value: -1m` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -289,9 +289,9 @@ func (s *Suite) TestPolicy_based_routing() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources:` + "\n" + `- client.yaml` + "\n" + `- config-file-nse.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources:` + "\n" + `- client.yaml` + "\n" + `- config-file-nse.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: nettools` + "\n" + ` labels:` + "\n" + ` app: nettools` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://icmp-responder/nsm-1` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: nettools` + "\n" + ` image: travelping/nettools:1.10.1` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` volumeMounts:` + "\n" + ` - mountPath: /etc/policy-based-routing/config.yaml` + "\n" + ` subPath: config.yaml` + "\n" + ` name: policies-config-volume` + "\n" + ` volumes:` + "\n" + ` - name: policies-config-volume` + "\n" + ` configMap:` + "\n" + ` name: policies-config-file` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -313,12 +313,12 @@ func (s *Suite) TestScale_from_zero() { r.Run(`kubectl delete ns ${NAMESPACE}`) r.Run(`kubectl delete -n nsm-system networkservices.networkservicemesh.io autoscale-icmp-responder`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{ .metadata.name }} {{end}}{{end}}'))` + "\n" + `NSC_NODE=${NODES[0]}` + "\n" + `SUPPLIER_NODE=${NODES[1]}` + "\n" + `if [ "$SUPPLIER_NODE" == "" ]; then SUPPLIER_NODE=$NSC_NODE; echo "Only 1 node found, testing that pod is created on the same node is useless"; fi`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` nodeName: $NSC_NODE` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://autoscale-icmp-responder/nsm-1` + "\n" + ` - name: NSM_REQUEST_TIMEOUT` + "\n" + ` value: 30s` + "\n" + `EOF`) r.Run(`cat > patch-supplier.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-supplier-k8s` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` nodeName: $SUPPLIER_NODE` + "\n" + ` containers:` + "\n" + ` - name: nse-supplier` + "\n" + ` env:` + "\n" + ` - name: NSM_SERVICE_NAME` + "\n" + ` value: autoscale-icmp-responder` + "\n" + ` - name: NSM_LABELS` + "\n" + ` value: app:icmp-responder-supplier` + "\n" + ` - name: NSM_NAMESPACE` + "\n" + ` valueFrom:` + "\n" + ` fieldRef:` + "\n" + ` fieldPath: metadata.namespace` + "\n" + ` - name: NSM_POD_DESCRIPTION_FILE` + "\n" + ` value: /run/supplier/pod-template.yaml` + "\n" + ` volumeMounts:` + "\n" + ` - name: pod-file` + "\n" + ` mountPath: /run/supplier` + "\n" + ` readOnly: true` + "\n" + ` volumes:` + "\n" + ` - name: pod-file` + "\n" + ` configMap:` + "\n" + ` name: supplier-pod-template-configmap` + "\n" + `EOF`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: $NAMESPACE` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-supplier-k8s?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-supplier.yaml` + "\n" + `` + "\n" + `configMapGenerator:` + "\n" + ` - name: supplier-pod-template-configmap` + "\n" + ` files:` + "\n" + ` - https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/scale-from-zero/pod-template.yaml` + "\n" + `EOF`) - r.Run(`kubectl apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/scale-from-zero/autoscale-netsvc.yaml`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: $NAMESPACE` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-supplier-k8s?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-supplier.yaml` + "\n" + `` + "\n" + `configMapGenerator:` + "\n" + ` - name: supplier-pod-template-configmap` + "\n" + ` files:` + "\n" + ` - https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/scale-from-zero/pod-template.yaml` + "\n" + `EOF`) + r.Run(`kubectl apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/scale-from-zero/autoscale-netsvc.yaml`) r.Run(`kubectl apply -k .`) r.Run(`kubectl wait -n $NAMESPACE --for=condition=ready --timeout=1m pod -l app=nse-supplier-k8s`) r.Run(`kubectl wait -n $NAMESPACE --for=condition=ready --timeout=1m pod -l app=nsc-kernel`) @@ -337,7 +337,7 @@ func (s *Suite) TestSelect_forwarder() { r.Run(`kubectl delete ns ns-select-forwarder`) }) r.Run(`kubectl create ns ns-select-forwarder`) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/features/select-forwarder?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/features/select-forwarder?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`kubectl wait --for=condition=ready --timeout=1m pod -l app=alpine -n ns-select-forwarder`) r.Run(`kubectl wait --for=condition=ready --timeout=1m pod -l app=nse-kernel -n ns-select-forwarder`) r.Run(`NSC=$(kubectl get pods -l app=alpine -n ns-select-forwarder --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')`) @@ -352,7 +352,7 @@ func (s *Suite) TestVl3_basic() { r.Run(`kubectl delete ns ns-vl3`) }) r.Run(`kubectl create ns ns-vl3`) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/features/vl3-basic?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/features/vl3-basic?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`nscs=$(kubectl get pods -l app=nsc-kernel -o go-template --template="{{range .items}}{{.metadata.name}} {{end}}" -n ns-vl3) ` + "\n" + `[[ ! -z $nscs ]]`) r.Run(`for nsc in $nscs ` + "\n" + `do` + "\n" + ` ipAddr=$(kubectl exec -n ns-vl3 $nsc -- ifconfig nsm-1)` + "\n" + ` ipAddr=$(echo $ipAddr | grep -Eo 'inet addr:[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'| cut -c 11-)` + "\n" + ` for pinger in $nscs` + "\n" + ` do` + "\n" + ` echo $pinger pings $ipAddr` + "\n" + ` kubectl exec $pinger -n ns-vl3 -- ping -c4 $ipAddr` + "\n" + ` done` + "\n" + `done`) r.Run(`for nsc in $nscs ` + "\n" + `do` + "\n" + ` echo $nsc pings nses` + "\n" + ` kubectl exec -n ns-vl3 $nsc -- ping 169.254.0.0 -c4` + "\n" + ` kubectl exec -n ns-vl3 $nsc -- ping 169.254.1.0 -c4` + "\n" + `done`) @@ -362,7 +362,7 @@ func (s *Suite) TestVl3_dns() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ns-dns-vl3`) }) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/features/vl3-dns?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/features/vl3-dns?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`nscs=$(kubectl get pods -l app=alpine -o go-template --template="{{range .items}}{{.metadata.name}} {{end}}" -n ns-dns-vl3) ` + "\n" + `[[ ! -z $nscs ]]`) r.Run(`for nsc in $nscs ` + "\n" + `do` + "\n" + ` for pinger in $nscs` + "\n" + ` do` + "\n" + ` kubectl exec $pinger -n ns-dns-vl3 -- ping -c4 $nsc.my-vl3-network` + "\n" + ` done` + "\n" + `done`) } @@ -372,7 +372,7 @@ func (s *Suite) TestVl3_scale_from_zero() { r.Run(`kubectl delete ns ns-vl3`) }) r.Run(`kubectl create ns ns-vl3`) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/features/vl3-scale-from-zero?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/features/vl3-scale-from-zero?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`kubectl wait -n ns-vl3 --for=condition=ready --timeout=1m pod -l app=nse-supplier-k8s`) r.Run(`kubectl wait -n ns-vl3 --for=condition=ready --timeout=1m pod -l app=nsc-kernel`) r.Run(`kubectl wait -n ns-vl3 --for=condition=ready --timeout=1m pod -l app=nse-vl3-vpp`) @@ -385,11 +385,11 @@ func (s *Suite) TestWebhook() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) r.Run(`cat > client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: nettools` + "\n" + ` labels:` + "\n" + ` app: nettools` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://my-nginx-service/nsm-1` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: nettools` + "\n" + ` image: travelping/nettools:1.10.1` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nginx` + "\n" + ` image: nginx` + "\n" + ` ports:` + "\n" + ` - containerPort: 80` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_SERVICE_NAMES` + "\n" + ` value: my-nginx-service` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `resources:` + "\n" + `- client.yaml` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `resources:` + "\n" + `- client.yaml` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) r.Run(`kubectl wait --for=condition=ready --timeout=5m pod -l app=nse-kernel -n ${NAMESPACE}`) r.Run(`kubectl wait --for=condition=ready --timeout=1m pod -l app=nettools -n ${NAMESPACE}`) diff --git a/suites/floating_interdomain/spire/suite.gen.go b/suites/floating_interdomain/spire/suite.gen.go index 034e6b3de4..91aff51a8c 100755 --- a/suites/floating_interdomain/spire/suite.gen.go +++ b/suites/floating_interdomain/spire/suite.gen.go @@ -29,15 +29,15 @@ func (s *Suite) SetupSuite() { r.Run(`[[ ! -z $KUBECONFIG2 ]]`) r.Run(`[[ ! -z $KUBECONFIG3 ]]`) r.Run(`export KUBECONFIG=$KUBECONFIG1`) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/floating_interdomain/spire/cluster1?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/floating_interdomain/spire/cluster1?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`kubectl wait -n spire --timeout=1m --for=condition=ready pod -l app=spire-agent`) r.Run(`kubectl wait -n spire --timeout=1m --for=condition=ready pod -l app=spire-server`) r.Run(`export KUBECONFIG=$KUBECONFIG2`) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/floating_interdomain/spire/cluster2?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/floating_interdomain/spire/cluster2?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`kubectl wait -n spire --timeout=1m --for=condition=ready pod -l app=spire-agent`) r.Run(`kubectl wait -n spire --timeout=1m --for=condition=ready pod -l app=spire-server`) r.Run(`export KUBECONFIG=$KUBECONFIG3`) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/floating_interdomain/spire/cluster3?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/floating_interdomain/spire/cluster3?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`kubectl wait -n spire --timeout=1m --for=condition=ready pod -l app=spire-agent`) r.Run(`kubectl wait -n spire --timeout=1m --for=condition=ready pod -l app=spire-server`) r.Run(`export KUBECONFIG=$KUBECONFIG1 && bundle1=$(kubectl exec spire-server-0 -n spire -- bin/spire-server bundle show -format spiffe)` + "\n" + `export KUBECONFIG=$KUBECONFIG2 && bundle2=$(kubectl exec spire-server-0 -n spire -- bin/spire-server bundle show -format spiffe)` + "\n" + `export KUBECONFIG=$KUBECONFIG3 && bundle3=$(kubectl exec spire-server-0 -n spire -- bin/spire-server bundle show -format spiffe)`) diff --git a/suites/floating_interdomain/suite.gen.go b/suites/floating_interdomain/suite.gen.go index fbdf91b383..b331851452 100755 --- a/suites/floating_interdomain/suite.gen.go +++ b/suites/floating_interdomain/suite.gen.go @@ -55,14 +55,14 @@ func (s *Suite) TestFloatingKernel2Vxlan2Kernel() { r.Run(`kubectl delete ns ${NAMESPACE2}`) }) r.Run(`export KUBECONFIG=$KUBECONFIG2`) - r.Run(`NAMESPACE1=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/floating_interdomain/usecases/namespace.yaml)[0])` + "\n" + `NAMESPACE1=${NAMESPACE1:10}`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE1}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`NAMESPACE1=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/floating_interdomain/usecases/namespace.yaml)[0])` + "\n" + `NAMESPACE1=${NAMESPACE1:10}`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE1}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` metadata:` + "\n" + ` annotations:` + "\n" + ` registration-name: icmp-server@my.cluster3` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_NAME` + "\n" + ` valueFrom:` + "\n" + ` fieldRef:` + "\n" + ` fieldPath: metadata.annotations['registration-name']` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.2/31` + "\n" + ` - name: NSM_SERVICE_NAMES` + "\n" + ` value: icmp-responder@my.cluster3` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) r.Run(`NSE=$(kubectl get pods -l app=nse-kernel -n ${NAMESPACE1} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `[[ ! -z $NSE ]]`) r.Run(`export KUBECONFIG=$KUBECONFIG1`) - r.Run(`NAMESPACE2=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/floating_interdomain/usecases/namespace.yaml)[0])` + "\n" + `NAMESPACE2=${NAMESPACE2:10}`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE2}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `EOF`) + r.Run(`NAMESPACE2=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/floating_interdomain/usecases/namespace.yaml)[0])` + "\n" + `NAMESPACE2=${NAMESPACE2:10}`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE2}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder@my.cluster3/nsm-1` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) r.Run(`kubectl wait --for=condition=ready --timeout=5m pod -l app=nsc-kernel -n ${NAMESPACE2}`) @@ -81,13 +81,13 @@ func (s *Suite) TestFloatingKernel2Wireguard2Kernel() { r.Run(`kubectl delete ns ${NAMESPACE2}`) }) r.Run(`export KUBECONFIG=$KUBECONFIG2`) - r.Run(`NAMESPACE1=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/floating_interdomain/usecases/namespace.yaml)[0])` + "\n" + `NAMESPACE1=${NAMESPACE1:10}`) + r.Run(`NAMESPACE1=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/floating_interdomain/usecases/namespace.yaml)[0])` + "\n" + `NAMESPACE1=${NAMESPACE1:10}`) r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE1}` + "\n" + `` + "\n" + `resources:` + "\n" + `- nse.yaml` + "\n" + `` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) r.Run(`NSE=$(kubectl get pods -l app=nse-kernel -n ${NAMESPACE1} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `[[ ! -z $NSE ]]`) r.Run(`export KUBECONFIG=$KUBECONFIG1`) - r.Run(`NAMESPACE2=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/floating_interdomain/usecases/namespace.yaml)[0])` + "\n" + `NAMESPACE2=${NAMESPACE2:10}`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE2}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `EOF`) + r.Run(`NAMESPACE2=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/floating_interdomain/usecases/namespace.yaml)[0])` + "\n" + `NAMESPACE2=${NAMESPACE2:10}`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE2}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://my-networkservice-ip@my.cluster3/nsm-1` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) r.Run(`kubectl wait --for=condition=ready --timeout=5m pod -l app=nsc-kernel -n ${NAMESPACE2}`) @@ -100,18 +100,18 @@ func (s *Suite) TestFloatingKernel2Wireguard2Kernel() { func (s *Suite) TestFloatingVl3() { r := s.Runner("../deployments-k8s/examples/floating_interdomain/usecases/FloatingVl3") s.T().Cleanup(func() { - r.Run(`export KUBECONFIG=$KUBECONFIG3 && kubectl delete -k https://github.com/networkservicemesh/deployments-k8s/examples/floating_interdomain/usecases/FloatingVl3/cluster3?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) - r.Run(`export KUBECONFIG=$KUBECONFIG2 && kubectl delete -k https://github.com/networkservicemesh/deployments-k8s/examples/floating_interdomain/usecases/FloatingVl3/cluster2?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) - r.Run(`export KUBECONFIG=$KUBECONFIG1 && kubectl delete -k https://github.com/networkservicemesh/deployments-k8s/examples/floating_interdomain/usecases/FloatingVl3/cluster1?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`export KUBECONFIG=$KUBECONFIG3 && kubectl delete -k https://github.com/networkservicemesh/deployments-k8s/examples/floating_interdomain/usecases/FloatingVl3/cluster3?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) + r.Run(`export KUBECONFIG=$KUBECONFIG2 && kubectl delete -k https://github.com/networkservicemesh/deployments-k8s/examples/floating_interdomain/usecases/FloatingVl3/cluster2?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) + r.Run(`export KUBECONFIG=$KUBECONFIG1 && kubectl delete -k https://github.com/networkservicemesh/deployments-k8s/examples/floating_interdomain/usecases/FloatingVl3/cluster1?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) }) r.Run(`export KUBECONFIG=$KUBECONFIG3`) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/floating_interdomain/usecases/FloatingVl3/cluster3?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/floating_interdomain/usecases/FloatingVl3/cluster3?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`export KUBECONFIG=$KUBECONFIG1`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `resources:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/examples/floating_interdomain/usecases/FloatingVl3/cluster1?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-vl3-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `resources:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/examples/floating_interdomain/usecases/FloatingVl3/cluster1?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-vl3-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-vl3-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: nse-vl3-vpp-1` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_PREFIX_SERVER_URL` + "\n" + ` value: "tcp://vl3-ipam.nsm-system.my.cluster3:5006"` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) r.Run(`export KUBECONFIG=$KUBECONFIG2`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `resources:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/examples/floating_interdomain/usecases/FloatingVl3/cluster2?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-vl3-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `resources:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/examples/floating_interdomain/usecases/FloatingVl3/cluster2?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-vl3-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-vl3-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: nse-vl3-vpp-2` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_PREFIX_SERVER_URL` + "\n" + ` value: "tcp://vl3-ipam.nsm-system.my.cluster3:5006"` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) r.Run(`nsc2=$(kubectl get pods -l app=nsc-kernel -n ns-vl3-interdomain --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')`) @@ -132,14 +132,14 @@ func (s *Suite) TestKernel2Vxlan2Kernel() { r.Run(`kubectl delete ns ${NAMESPACE1}`) }) r.Run(`export KUBECONFIG=$KUBECONFIG2`) - r.Run(`NAMESPACE1=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/floating_interdomain/usecases/namespace.yaml)[0])` + "\n" + `NAMESPACE1=${NAMESPACE1:10}`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE1}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`NAMESPACE1=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/floating_interdomain/usecases/namespace.yaml)[0])` + "\n" + `NAMESPACE1=${NAMESPACE1:10}`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE1}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.2/31` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) r.Run(`NSE=$(kubectl get pods -l app=nse-kernel -n ${NAMESPACE1} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `[[ ! -z $NSE ]]`) r.Run(`export KUBECONFIG=$KUBECONFIG1`) - r.Run(`NAMESPACE2=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/floating_interdomain/usecases/namespace.yaml)[0])` + "\n" + `NAMESPACE2=${NAMESPACE2:10}`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE2}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `EOF`) + r.Run(`NAMESPACE2=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/floating_interdomain/usecases/namespace.yaml)[0])` + "\n" + `NAMESPACE2=${NAMESPACE2:10}`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE2}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder@my.cluster2/nsm-1` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) r.Run(`kubectl wait --for=condition=ready --timeout=5m pod -l app=nsc-kernel -n ${NAMESPACE2}`) @@ -158,14 +158,14 @@ func (s *Suite) TestKernel2Wireguard2Kernel() { r.Run(`kubectl delete ns ${NAMESPACE1}`) }) r.Run(`export KUBECONFIG=$KUBECONFIG2`) - r.Run(`NAMESPACE1=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/floating_interdomain/usecases/namespace.yaml)[0])` + "\n" + `NAMESPACE1=${NAMESPACE1:10}`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE1}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`NAMESPACE1=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/floating_interdomain/usecases/namespace.yaml)[0])` + "\n" + `NAMESPACE1=${NAMESPACE1:10}`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE1}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.2/31` + "\n" + ` - name: NSM_PAYLOAD` + "\n" + ` value: IP` + "\n" + ` - name: NSM_SERVICE_NAMES` + "\n" + ` value: my-networkservice-ip` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) r.Run(`NSE=$(kubectl get pods -l app=nse-kernel -n ${NAMESPACE1} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `[[ ! -z $NSE ]]`) r.Run(`export KUBECONFIG=$KUBECONFIG1`) - r.Run(`NAMESPACE2=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/floating_interdomain/usecases/namespace.yaml)[0])` + "\n" + `NAMESPACE2=${NAMESPACE2:10}`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE2}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `EOF`) + r.Run(`NAMESPACE2=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/floating_interdomain/usecases/namespace.yaml)[0])` + "\n" + `NAMESPACE2=${NAMESPACE2:10}`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE2}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://my-networkservice-ip@my.cluster2/nsm-1` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) r.Run(`kubectl wait --for=condition=ready --timeout=5m pod -l app=nsc-kernel -n ${NAMESPACE2}`) diff --git a/suites/heal/suite.gen.go b/suites/heal/suite.gen.go index 70c3fc3399..e9dc82e78c 100755 --- a/suites/heal/suite.gen.go +++ b/suites/heal/suite.gen.go @@ -29,9 +29,9 @@ func (s *Suite) TestDataplane_interrupt() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1` + "\n" + ` - name: alpine` + "\n" + ` securityContext:` + "\n" + ` capabilities:` + "\n" + ` add: ["NET_ADMIN"]` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -52,9 +52,9 @@ func (s *Suite) TestLocal_forwarder_death() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -75,9 +75,9 @@ func (s *Suite) TestLocal_forwarder_remote_forwarder() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1` + "\n" + `` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -101,9 +101,9 @@ func (s *Suite) TestLocal_nse_death() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1` + "\n" + `` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -128,9 +128,9 @@ func (s *Suite) TestLocal_nsm_system_restart() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -142,7 +142,7 @@ func (s *Suite) TestLocal_nsm_system_restart() { r.Run(`kubectl exec ${NSE} -n ${NAMESPACE} -- ping -c 4 172.16.1.101`) r.Run(`WH=$(kubectl get pods -l app=admission-webhook-k8s -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `kubectl delete mutatingwebhookconfiguration ${WH}` + "\n" + `kubectl delete ns nsm-system`) r.Run(`kubectl create ns nsm-system`) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/basic?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/basic?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`kubectl exec ${NSC} -n ${NAMESPACE} -- ping -c 4 172.16.1.100`) r.Run(`kubectl exec ${NSE} -n ${NAMESPACE} -- ping -c 4 172.16.1.101`) } @@ -151,9 +151,9 @@ func (s *Suite) TestLocal_nsmgr_local_forwarder_memif() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: memif://icmp-responder/nsm-1` + "\n" + `` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -177,9 +177,9 @@ func (s *Suite) TestLocal_nsmgr_local_nse_memif() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: memif://icmp-responder/nsm-1` + "\n" + `` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -205,9 +205,9 @@ func (s *Suite) TestLocal_nsmgr_remote_nsmgr() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1` + "\n" + `` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -231,9 +231,9 @@ func (s *Suite) TestLocal_nsmgr_restart() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1` + "\n" + `` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -254,9 +254,9 @@ func (s *Suite) TestRegistry_local_endpoint() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -281,9 +281,9 @@ func (s *Suite) TestRegistry_remote_forwarder() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1` + "\n" + `` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -307,9 +307,9 @@ func (s *Suite) TestRegistry_remote_nsmgr() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1` + "\n" + `` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -333,9 +333,9 @@ func (s *Suite) TestRegistry_restart() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/30` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -348,7 +348,7 @@ func (s *Suite) TestRegistry_restart() { r.Run(`REGISTRY=$(kubectl get pods -l app=registry -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')`) r.Run(`kubectl delete pod ${REGISTRY} -n nsm-system`) r.Run(`kubectl wait --for=condition=ready --timeout=1m pod -l app=registry -n nsm-system`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesJson6902:` + "\n" + `- target:` + "\n" + ` group: apps` + "\n" + ` version: v1` + "\n" + ` kind: Deployment` + "\n" + ` name: nsc-kernel` + "\n" + ` path: patch-nsc.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesJson6902:` + "\n" + `- target:` + "\n" + ` group: apps` + "\n" + ` version: v1` + "\n" + ` kind: Deployment` + "\n" + ` name: nsc-kernel` + "\n" + ` path: patch-nsc.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `- op: replace` + "\n" + ` path: /metadata/name` + "\n" + ` value: nsc-kernel-new` + "\n" + `- op: replace` + "\n" + ` path: /metadata/labels/app` + "\n" + ` value: nsc-kernel-new` + "\n" + `- op: replace` + "\n" + ` path: /spec/selector/matchLabels/app` + "\n" + ` value: nsc-kernel-new` + "\n" + `- op: replace` + "\n" + ` path: /spec/template/metadata/labels/app` + "\n" + ` value: nsc-kernel-new` + "\n" + `- op: add` + "\n" + ` path: /spec/template/spec/containers/0/env/-` + "\n" + ` value:` + "\n" + ` name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) r.Run(`kubectl wait --for=condition=ready --timeout=1m pod -l app=nsc-kernel-new -n ${NAMESPACE}`) @@ -361,9 +361,9 @@ func (s *Suite) TestRemote_forwarder_death() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -384,9 +384,9 @@ func (s *Suite) TestRemote_forwarder_death_ip() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder-ip/nsm-1` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` - name: NSM_PAYLOAD` + "\n" + ` value: IP` + "\n" + ` - name: NSM_SERVICE_NAMES` + "\n" + ` value: icmp-responder-ip` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -407,9 +407,9 @@ func (s *Suite) TestRemote_nse_death() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1` + "\n" + `` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -431,9 +431,9 @@ func (s *Suite) TestRemote_nse_death_ip() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder-ip/nsm-1` + "\n" + `` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` - name: NSM_PAYLOAD` + "\n" + ` value: IP` + "\n" + ` - name: NSM_SERVICE_NAMES` + "\n" + ` value: icmp-responder-ip` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -457,7 +457,7 @@ func (s *Suite) TestRemote_nsm_system_restart_memif_ip() { }) r.Run(`NAMESPACE=($(kubectl create -f ../../../examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: memif://icmp-responder-ip/nsm-1` + "\n" + `` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` - name: NSM_PAYLOAD` + "\n" + ` value: IP` + "\n" + ` - name: NSM_SERVICE_NAMES` + "\n" + ` value: icmp-responder-ip` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -469,19 +469,19 @@ func (s *Suite) TestRemote_nsm_system_restart_memif_ip() { r.Run(`result=$(kubectl exec "${NSE}" -n "${NAMESPACE}" -- vppctl ping 172.16.1.101 repeat 4)` + "\n" + `echo ${result}` + "\n" + `! echo ${result} | grep -E -q "(100% packet loss)|(0 sent)|(no egress interface)"`) r.Run(`WH=$(kubectl get pods -l app=admission-webhook-k8s -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `kubectl delete mutatingwebhookconfiguration ${WH}` + "\n" + `kubectl delete ns nsm-system`) r.Run(`kubectl create ns nsm-system`) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/basic?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/basic?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`result=$(kubectl exec "${NSC}" -n "${NAMESPACE}" -- vppctl ping 172.16.1.100 repeat 4)` + "\n" + `echo ${result}` + "\n" + `! echo ${result} | grep -E -q "(100% packet loss)|(0 sent)|(no egress interface)"`) r.Run(`result=$(kubectl exec "${NSE}" -n "${NAMESPACE}" -- vppctl ping 172.16.1.101 repeat 4)` + "\n" + `echo ${result}` + "\n" + `! echo ${result} | grep -E -q "(100% packet loss)|(0 sent)|(no egress interface)"`) } func (s *Suite) TestRemote_nsmgr_death() { r := s.Runner("../deployments-k8s/examples/heal/remote-nsmgr-death") s.T().Cleanup(func() { - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/apps/nsmgr?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf -n nsm-system`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/apps/nsmgr?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a -n nsm-system`) r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1` + "\n" + `` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -491,10 +491,10 @@ func (s *Suite) TestRemote_nsmgr_death() { r.Run(`NSE=$(kubectl get pods -l app=nse-kernel -n ${NAMESPACE} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')`) r.Run(`kubectl exec ${NSC} -n ${NAMESPACE} -- ping -c 4 172.16.1.100`) r.Run(`kubectl exec ${NSE} -n ${NAMESPACE} -- ping -c 4 172.16.1.101`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: nsm-system` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsmgr?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsmgr.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: nsm-system` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsmgr?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsmgr.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsmgr.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: DaemonSet` + "\n" + `metadata:` + "\n" + ` name: nsmgr` + "\n" + `spec:` + "\n" + ` updateStrategy:` + "\n" + ` type: OnDelete` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsmgr` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.102/31` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) r.Run(`kubectl wait --for=condition=ready --timeout=1m pod -l app=nse-kernel --field-selector spec.nodeName==${NODES[0]} -n ${NAMESPACE}`) @@ -507,9 +507,9 @@ func (s *Suite) TestRemote_nsmgr_remote_endpoint() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1` + "\n" + `` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -534,9 +534,9 @@ func (s *Suite) TestRemote_nsmgr_restart() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -557,9 +557,9 @@ func (s *Suite) TestRemote_nsmgr_restart_ip() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/heal/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder-ip/nsm-1` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` - name: NSM_PAYLOAD` + "\n" + ` value: IP` + "\n" + ` - name: NSM_SERVICE_NAMES` + "\n" + ` value: icmp-responder-ip` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) diff --git a/suites/interdomain/nsm/suite.gen.go b/suites/interdomain/nsm/suite.gen.go index ef1d166e31..99a90fbfcf 100755 --- a/suites/interdomain/nsm/suite.gen.go +++ b/suites/interdomain/nsm/suite.gen.go @@ -23,9 +23,9 @@ func (s *Suite) SetupSuite() { } r := s.Runner("../deployments-k8s/examples/interdomain/nsm") s.T().Cleanup(func() { - r.Run(`WH=$(kubectl --kubeconfig=$KUBECONFIG1 get pods -l app=admission-webhook-k8s -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `kubectl --kubeconfig=$KUBECONFIG1 delete mutatingwebhookconfiguration ${WH}` + "\n" + `` + "\n" + `WH=$(kubectl --kubeconfig=$KUBECONFIG2 get pods -l app=admission-webhook-k8s -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 delete mutatingwebhookconfiguration ${WH}` + "\n" + `` + "\n" + `kubectl --kubeconfig=$KUBECONFIG1 delete -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/nsm/cluster1?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 delete -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/nsm/cluster2?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`WH=$(kubectl --kubeconfig=$KUBECONFIG1 get pods -l app=admission-webhook-k8s -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `kubectl --kubeconfig=$KUBECONFIG1 delete mutatingwebhookconfiguration ${WH}` + "\n" + `` + "\n" + `WH=$(kubectl --kubeconfig=$KUBECONFIG2 get pods -l app=admission-webhook-k8s -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 delete mutatingwebhookconfiguration ${WH}` + "\n" + `` + "\n" + `kubectl --kubeconfig=$KUBECONFIG1 delete -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/nsm/cluster1?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 delete -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/nsm/cluster2?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) }) - r.Run(`kubectl --kubeconfig=$KUBECONFIG1 apply -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/nsm/cluster1?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 apply -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/nsm/cluster2?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl --kubeconfig=$KUBECONFIG1 apply -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/nsm/cluster1?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 apply -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/nsm/cluster2?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`WH=$(kubectl --kubeconfig=$KUBECONFIG1 get pods -l app=admission-webhook-k8s -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `kubectl --kubeconfig=$KUBECONFIG1 wait --for=condition=ready --timeout=1m pod ${WH} -n nsm-system` + "\n" + `` + "\n" + `WH=$(kubectl --kubeconfig=$KUBECONFIG2 get pods -l app=admission-webhook-k8s -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 wait --for=condition=ready --timeout=1m pod ${WH} -n nsm-system`) } func (s *Suite) Test() {} diff --git a/suites/interdomain/nsm_istio_booking/suite.gen.go b/suites/interdomain/nsm_istio_booking/suite.gen.go index a8b1c4aec8..2015f5db88 100755 --- a/suites/interdomain/nsm_istio_booking/suite.gen.go +++ b/suites/interdomain/nsm_istio_booking/suite.gen.go @@ -31,12 +31,12 @@ func (s *Suite) SetupSuite() { } r := s.Runner("../deployments-k8s/examples/interdomain/nsm_istio_booking") s.T().Cleanup(func() { - r.Run(`kubectl --kubeconfig=$KUBECONFIG2 delete -f https://raw.githubusercontent.com/istio/istio/release-1.13/samples/bookinfo/platform/kube/bookinfo.yaml` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 delete -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/nsm_istio_booking/nse-auto-scale?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf ` + "\n" + `kubectl --kubeconfig=$KUBECONFIG1 delete -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/interdomain/nsm_istio_booking/productpage/productpage.yaml` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 delete -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/interdomain/nsm_istio_booking/networkservice.yaml` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 delete ns istio-system` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 label namespace default istio-injection-` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 delete pods --all`) + r.Run(`kubectl --kubeconfig=$KUBECONFIG2 delete -f https://raw.githubusercontent.com/istio/istio/release-1.13/samples/bookinfo/platform/kube/bookinfo.yaml` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 delete -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/nsm_istio_booking/nse-auto-scale?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a ` + "\n" + `kubectl --kubeconfig=$KUBECONFIG1 delete -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/interdomain/nsm_istio_booking/productpage/productpage.yaml` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 delete -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/interdomain/nsm_istio_booking/networkservice.yaml` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 delete ns istio-system` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 label namespace default istio-injection-` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 delete pods --all`) }) r.Run(`curl -sL https://istio.io/downloadIstioctl | sh -` + "\n" + `export PATH=$PATH:$HOME/.istioctl/bin` + "\n" + `istioctl install --set profile=minimal -y --kubeconfig=$KUBECONFIG2` + "\n" + `istioctl --kubeconfig=$KUBECONFIG2 proxy-status`) - r.Run(`kubectl --kubeconfig=$KUBECONFIG2 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/interdomain/nsm_istio_booking/networkservice.yaml`) - r.Run(`kubectl --kubeconfig=$KUBECONFIG1 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/interdomain/nsm_istio_booking/productpage/productpage.yaml`) - r.Run(`kubectl --kubeconfig=$KUBECONFIG2 apply -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/nsm_istio_booking/nse-auto-scale?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl --kubeconfig=$KUBECONFIG2 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/interdomain/nsm_istio_booking/networkservice.yaml`) + r.Run(`kubectl --kubeconfig=$KUBECONFIG1 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/interdomain/nsm_istio_booking/productpage/productpage.yaml`) + r.Run(`kubectl --kubeconfig=$KUBECONFIG2 apply -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/nsm_istio_booking/nse-auto-scale?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`kubectl --kubeconfig=$KUBECONFIG2 label namespace default istio-injection=enabled` + "\n" + `` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 apply -f https://raw.githubusercontent.com/istio/istio/release-1.13/samples/bookinfo/platform/kube/bookinfo.yaml`) r.Run(`kubectl --kubeconfig=$KUBECONFIG1 wait --timeout=2m --for=condition=ready pod -l app=productpage`) r.Run(`kubectl --kubeconfig=$KUBECONFIG1 exec deploy/productpage-v1 -c cmd-nsc -- apk add curl`) diff --git a/suites/interdomain/spire/suite.gen.go b/suites/interdomain/spire/suite.gen.go index 7028366f0f..1be81072ab 100755 --- a/suites/interdomain/spire/suite.gen.go +++ b/suites/interdomain/spire/suite.gen.go @@ -27,7 +27,7 @@ func (s *Suite) SetupSuite() { }) r.Run(`[[ ! -z $KUBECONFIG1 ]]`) r.Run(`[[ ! -z $KUBECONFIG2 ]]`) - r.Run(`kubectl --kubeconfig=$KUBECONFIG1 apply -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/spire/cluster1?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 apply -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/spire/cluster2?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl --kubeconfig=$KUBECONFIG1 apply -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/spire/cluster1?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 apply -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/spire/cluster2?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`kubectl --kubeconfig=$KUBECONFIG1 wait -n spire --timeout=1m --for=condition=ready pod -l app=spire-agent` + "\n" + `kubectl --kubeconfig=$KUBECONFIG1 wait -n spire --timeout=1m --for=condition=ready pod -l app=spire-server` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 wait -n spire --timeout=1m --for=condition=ready pod -l app=spire-agent` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 wait -n spire --timeout=1m --for=condition=ready pod -l app=spire-server`) r.Run(`bundle1=$(kubectl --kubeconfig=$KUBECONFIG1 exec spire-server-0 -n spire -- bin/spire-server bundle show -format spiffe)` + "\n" + `bundle2=$(kubectl --kubeconfig=$KUBECONFIG2 exec spire-server-0 -n spire -- bin/spire-server bundle show -format spiffe)`) r.Run(`echo $bundle2 | kubectl --kubeconfig=$KUBECONFIG1 exec -i spire-server-0 -n spire -- bin/spire-server bundle set -format spiffe -id "spiffe://nsm.cluster2"` + "\n" + `echo $bundle1 | kubectl --kubeconfig=$KUBECONFIG2 exec -i spire-server-0 -n spire -- bin/spire-server bundle set -format spiffe -id "spiffe://nsm.cluster1"`) diff --git a/suites/interdomain/suite.gen.go b/suites/interdomain/suite.gen.go index b54fd4eefe..b96271de5a 100755 --- a/suites/interdomain/suite.gen.go +++ b/suites/interdomain/suite.gen.go @@ -34,36 +34,36 @@ func (s *Suite) TestNsm_consul() { r := s.Runner("../deployments-k8s/examples/interdomain/nsm_consul") s.T().Cleanup(func() { r.Run(`kubectl --kubeconfig=$KUBECONFIG1 delete deployment counting`) - r.Run(`kubectl --kubeconfig=$KUBECONFIG2 delete -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/nsm_consul/nse-auto-scale?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) - r.Run(`kubectl --kubeconfig=$KUBECONFIG1 delete -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/interdomain/nsm_consul/client/dashboard.yaml`) - r.Run(`kubectl --kubeconfig=$KUBECONFIG2 delete -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/interdomain/nsm_consul/networkservice.yaml`) + r.Run(`kubectl --kubeconfig=$KUBECONFIG2 delete -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/nsm_consul/nse-auto-scale?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) + r.Run(`kubectl --kubeconfig=$KUBECONFIG1 delete -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/interdomain/nsm_consul/client/dashboard.yaml`) + r.Run(`kubectl --kubeconfig=$KUBECONFIG2 delete -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/interdomain/nsm_consul/networkservice.yaml`) r.Run(`kubectl --kubeconfig=$KUBECONFIG2 delete pods --all`) r.Run(`consul-k8s uninstall --kubeconfig=$KUBECONFIG2 -auto-approve=true -wipe-data=true`) }) r.Run(`brew tap hashicorp/tap` + "\n" + `brew install hashicorp/tap/consul-k8s`) r.Run(`consul-k8s install -config-file=helm-consul-values.yaml -set global.image=hashicorp/consul:1.12.0 -auto-approve --kubeconfig=$KUBECONFIG2`) - r.Run(`kubectl --kubeconfig=$KUBECONFIG2 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/interdomain/nsm_consul/networkservice.yaml`) - r.Run(`kubectl --kubeconfig=$KUBECONFIG1 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/interdomain/nsm_consul/client/dashboard.yaml`) - r.Run(`kubectl --kubeconfig=$KUBECONFIG2 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/interdomain/nsm_consul/service.yaml`) - r.Run(`kubectl --kubeconfig=$KUBECONFIG2 apply -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/nsm_consul/nse-auto-scale?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) - r.Run(`kubectl --kubeconfig=$KUBECONFIG2 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/interdomain/nsm_consul/server/counting.yaml`) + r.Run(`kubectl --kubeconfig=$KUBECONFIG2 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/interdomain/nsm_consul/networkservice.yaml`) + r.Run(`kubectl --kubeconfig=$KUBECONFIG1 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/interdomain/nsm_consul/client/dashboard.yaml`) + r.Run(`kubectl --kubeconfig=$KUBECONFIG2 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/interdomain/nsm_consul/service.yaml`) + r.Run(`kubectl --kubeconfig=$KUBECONFIG2 apply -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/nsm_consul/nse-auto-scale?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) + r.Run(`kubectl --kubeconfig=$KUBECONFIG2 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/interdomain/nsm_consul/server/counting.yaml`) r.Run(`kubectl --kubeconfig=$KUBECONFIG1 wait --timeout=5m --for=condition=ready pod -l app=dashboard-nsc`) r.Run(`kubectl --kubeconfig=$KUBECONFIG1 exec pod/dashboard-nsc -c cmd-nsc -- apk add curl`) r.Run(`kubectl --kubeconfig=$KUBECONFIG1 exec pod/dashboard-nsc -c cmd-nsc -- curl counting:9001`) r.Run(`kubectl --kubeconfig=$KUBECONFIG1 port-forward pod/dashboard-nsc 9002:9002 &`) r.Run(`kubectl --kubeconfig=$KUBECONFIG2 delete deploy counting`) - r.Run(`kubectl --kubeconfig=$KUBECONFIG1 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/interdomain/nsm_consul/server/counting_nsm.yaml`) + r.Run(`kubectl --kubeconfig=$KUBECONFIG1 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/interdomain/nsm_consul/server/counting_nsm.yaml`) } func (s *Suite) TestNsm_istio() { r := s.Runner("../deployments-k8s/examples/interdomain/nsm_istio") s.T().Cleanup(func() { - r.Run(`kubectl --kubeconfig=$KUBECONFIG2 delete -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/interdomain/nsm_istio/greeting/server.yaml` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 delete -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/nsm_istio/nse-auto-scale?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `kubectl --kubeconfig=$KUBECONFIG1 delete -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/interdomain/nsm_istio/greeting/client.yaml` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 delete -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/interdomain/nsm_istio/networkservice.yaml` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 delete ns istio-system` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 label namespace default istio-injection-` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 delete pods --all`) + r.Run(`kubectl --kubeconfig=$KUBECONFIG2 delete -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/interdomain/nsm_istio/greeting/server.yaml` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 delete -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/nsm_istio/nse-auto-scale?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `kubectl --kubeconfig=$KUBECONFIG1 delete -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/interdomain/nsm_istio/greeting/client.yaml` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 delete -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/interdomain/nsm_istio/networkservice.yaml` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 delete ns istio-system` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 label namespace default istio-injection-` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 delete pods --all`) }) r.Run(`curl -sL https://istio.io/downloadIstioctl | sh -` + "\n" + `export PATH=$PATH:$HOME/.istioctl/bin` + "\n" + `istioctl install --set profile=minimal -y --kubeconfig=$KUBECONFIG2` + "\n" + `istioctl --kubeconfig=$KUBECONFIG2 proxy-status`) - r.Run(`kubectl --kubeconfig=$KUBECONFIG2 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/interdomain/nsm_istio/networkservice.yaml`) - r.Run(`kubectl --kubeconfig=$KUBECONFIG1 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/interdomain/nsm_istio/greeting/client.yaml`) - r.Run(`kubectl --kubeconfig=$KUBECONFIG2 apply -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/nsm_istio/nse-auto-scale?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) - r.Run(`kubectl --kubeconfig=$KUBECONFIG2 label namespace default istio-injection=enabled` + "\n" + `` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/interdomain/nsm_istio/greeting/server.yaml`) + r.Run(`kubectl --kubeconfig=$KUBECONFIG2 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/interdomain/nsm_istio/networkservice.yaml`) + r.Run(`kubectl --kubeconfig=$KUBECONFIG1 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/interdomain/nsm_istio/greeting/client.yaml`) + r.Run(`kubectl --kubeconfig=$KUBECONFIG2 apply -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/nsm_istio/nse-auto-scale?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) + r.Run(`kubectl --kubeconfig=$KUBECONFIG2 label namespace default istio-injection=enabled` + "\n" + `` + "\n" + `kubectl --kubeconfig=$KUBECONFIG2 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/interdomain/nsm_istio/greeting/server.yaml`) r.Run(`kubectl --kubeconfig=$KUBECONFIG1 wait --timeout=2m --for=condition=ready pod -l app=alpine`) r.Run(`kubectl --kubeconfig=$KUBECONFIG1 exec deploy/alpine -c cmd-nsc -- apk add curl`) r.Run(`kubectl --kubeconfig=$KUBECONFIG1 exec deploy/alpine -c cmd-nsc -- curl -s greeting.default:9080 | grep -o "hello world from istio"`) diff --git a/suites/k8s_monolith/external_nsc/docker/suite.gen.go b/suites/k8s_monolith/external_nsc/docker/suite.gen.go index be547112ed..705d0dcaa6 100755 --- a/suites/k8s_monolith/external_nsc/docker/suite.gen.go +++ b/suites/k8s_monolith/external_nsc/docker/suite.gen.go @@ -26,7 +26,7 @@ func (s *Suite) SetupSuite() { r.Run(`docker compose -f docker-compose.yaml -f docker-compose.override.yaml down`) }) r.Run(`cat > docker-compose.override.yaml <<EOF` + "\n" + `---` + "\n" + `networks:` + "\n" + ` kind:` + "\n" + ` external: true` + "\n" + `` + "\n" + `services:` + "\n" + ` nsc-simple-docker:` + "\n" + ` networks:` + "\n" + ` - kind` + "\n" + ` environment:` + "\n" + ` NSM_NETWORK_SERVICES: kernel://icmp-responder-ip@k8s.nsm/nsm-1` + "\n" + `EOF`) - r.Run(`curl https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/apps/nsc-simple-docker/docker-compose.yaml -o docker-compose.yaml`) + r.Run(`curl https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/apps/nsc-simple-docker/docker-compose.yaml -o docker-compose.yaml`) r.Run(`docker compose -f docker-compose.yaml -f docker-compose.override.yaml up -d`) } func (s *Suite) Test() {} diff --git a/suites/k8s_monolith/external_nsc/spire/suite.gen.go b/suites/k8s_monolith/external_nsc/spire/suite.gen.go index dd551692a8..3df41e727a 100755 --- a/suites/k8s_monolith/external_nsc/spire/suite.gen.go +++ b/suites/k8s_monolith/external_nsc/spire/suite.gen.go @@ -25,7 +25,7 @@ func (s *Suite) SetupSuite() { s.T().Cleanup(func() { r.Run(`kubectl delete crd spiffeids.spiffeid.spiffe.io` + "\n" + `kubectl delete ns spire`) }) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/k8s_monolith/configuration/spire?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/k8s_monolith/configuration/spire?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`kubectl wait -n spire --timeout=1m --for=condition=ready pod -l app=spire-agent`) r.Run(`kubectl wait -n spire --timeout=1m --for=condition=ready pod -l app=spire-server`) r.Run(`bundlek8s=$(kubectl exec spire-server-0 -n spire -- bin/spire-server bundle show -format spiffe)` + "\n" + `bundledock=$(docker exec nsc-simple-docker bin/spire-server bundle show -format spiffe)` + "\n" + `echo $bundledock | kubectl exec -i spire-server-0 -n spire -- bin/spire-server bundle set -format spiffe -id "spiffe://docker.nsm/cmd-nsc-simple-docker"` + "\n" + `echo $bundlek8s | docker exec -i nsc-simple-docker bin/spire-server bundle set -format spiffe -id "spiffe://k8s.nsm"`) diff --git a/suites/k8s_monolith/external_nsc/suite.gen.go b/suites/k8s_monolith/external_nsc/suite.gen.go index 3cc98f90f2..64f7ab84c0 100755 --- a/suites/k8s_monolith/external_nsc/suite.gen.go +++ b/suites/k8s_monolith/external_nsc/suite.gen.go @@ -32,7 +32,7 @@ func (s *Suite) SetupSuite() { r.Run(`kubectl delete ns nsm-system`) }) r.Run(`kubectl create ns nsm-system`) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/k8s_monolith/configuration/cluster?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/k8s_monolith/configuration/cluster?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`kubectl get services registry -n nsm-system -o go-template='{{index (index (index (index .status "loadBalancer") "ingress") 0) "ip"}}'`) } func (s *Suite) TestKernel2Wireguard2Kernel() { @@ -40,8 +40,8 @@ func (s *Suite) TestKernel2Wireguard2Kernel() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/k8s_monolith/external_nsc/usecases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/k8s_monolith/external_nsc/usecases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` - name: NSM_PAYLOAD` + "\n" + ` value: IP` + "\n" + ` - name: NSM_SERVICE_NAMES` + "\n" + ` value: icmp-responder-ip` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) r.Run(`kubectl wait --for=condition=ready --timeout=1m pod -l app=nse-kernel -n ${NAMESPACE}`) diff --git a/suites/k8s_monolith/external_nse/docker/suite.gen.go b/suites/k8s_monolith/external_nse/docker/suite.gen.go index 16d04e86cd..fb648e8988 100755 --- a/suites/k8s_monolith/external_nse/docker/suite.gen.go +++ b/suites/k8s_monolith/external_nse/docker/suite.gen.go @@ -26,7 +26,7 @@ func (s *Suite) SetupSuite() { r.Run(`docker compose -f docker-compose.yaml -f docker-compose.override.yaml down`) }) r.Run(`cat > docker-compose.override.yaml <<EOF` + "\n" + `---` + "\n" + `networks:` + "\n" + ` kind:` + "\n" + ` external: true` + "\n" + `` + "\n" + `services:` + "\n" + ` nse-simple-vl3-docker:` + "\n" + ` networks:` + "\n" + ` - kind` + "\n" + `EOF`) - r.Run(`curl https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/apps/nse-simple-vl3-docker/docker-compose.yaml -o docker-compose.yaml`) + r.Run(`curl https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/apps/nse-simple-vl3-docker/docker-compose.yaml -o docker-compose.yaml`) r.Run(`docker compose -f docker-compose.yaml -f docker-compose.override.yaml up -d`) } func (s *Suite) Test() {} diff --git a/suites/k8s_monolith/external_nse/spire/suite.gen.go b/suites/k8s_monolith/external_nse/spire/suite.gen.go index 557c927989..f9f62c80b2 100755 --- a/suites/k8s_monolith/external_nse/spire/suite.gen.go +++ b/suites/k8s_monolith/external_nse/spire/suite.gen.go @@ -25,7 +25,7 @@ func (s *Suite) SetupSuite() { s.T().Cleanup(func() { r.Run(`kubectl delete crd spiffeids.spiffeid.spiffe.io` + "\n" + `kubectl delete ns spire`) }) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/k8s_monolith/configuration/spire?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/k8s_monolith/configuration/spire?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`kubectl wait -n spire --timeout=1m --for=condition=ready pod -l app=spire-agent`) r.Run(`kubectl wait -n spire --timeout=1m --for=condition=ready pod -l app=spire-server`) r.Run(`bundlek8s=$(kubectl exec spire-server-0 -n spire -- bin/spire-server bundle show -format spiffe)` + "\n" + `bundledock=$(docker exec nse-simple-vl3-docker bin/spire-server bundle show -format spiffe)` + "\n" + `echo $bundledock | kubectl exec -i spire-server-0 -n spire -- bin/spire-server bundle set -format spiffe -id "spiffe://docker.nsm/cmd-nse-simple-vl3-docker"` + "\n" + `echo $bundlek8s | docker exec -i nse-simple-vl3-docker bin/spire-server bundle set -format spiffe -id "spiffe://k8s.nsm"`) diff --git a/suites/k8s_monolith/external_nse/suite.gen.go b/suites/k8s_monolith/external_nse/suite.gen.go index 5de955b0fa..c14b691c25 100755 --- a/suites/k8s_monolith/external_nse/suite.gen.go +++ b/suites/k8s_monolith/external_nse/suite.gen.go @@ -32,7 +32,7 @@ func (s *Suite) SetupSuite() { r.Run(`kubectl delete ns nsm-system`) }) r.Run(`kubectl create ns nsm-system`) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/k8s_monolith/configuration/cluster?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/k8s_monolith/configuration/cluster?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`kubectl get services registry -n nsm-system -o go-template='{{index (index (index (index .status "loadBalancer") "ingress") 0) "ip"}}'`) } func (s *Suite) TestKernel2Wireguard2Kernel() { @@ -40,8 +40,8 @@ func (s *Suite) TestKernel2Wireguard2Kernel() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/k8s_monolith/external_nse/usecases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `EOF`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/k8s_monolith/external_nse/usecases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` replicas: 2` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://docker-vl3/nsm-1` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) r.Run(`kubectl wait --for=condition=ready --timeout=1m pod -l app=nsc-kernel -n ${NAMESPACE}`) diff --git a/suites/memory/suite.gen.go b/suites/memory/suite.gen.go index 98e8df2de4..d715fa787a 100755 --- a/suites/memory/suite.gen.go +++ b/suites/memory/suite.gen.go @@ -28,7 +28,7 @@ func (s *Suite) SetupSuite() { r.Run(`WH=$(kubectl get pods -l app=admission-webhook-k8s -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `kubectl delete mutatingwebhookconfiguration ${WH}` + "\n" + `kubectl delete ns nsm-system`) }) r.Run(`kubectl create ns nsm-system`) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/memory?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/memory?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`WH=$(kubectl get pods -l app=admission-webhook-k8s -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `kubectl wait --for=condition=ready --timeout=1m pod ${WH} -n nsm-system`) } func (s *Suite) TestKernel2Kernel() { @@ -36,9 +36,9 @@ func (s *Suite) TestKernel2Kernel() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: alpine` + "\n" + ` labels:` + "\n" + ` app: alpine ` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://icmp-responder/nsm-1` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -54,9 +54,9 @@ func (s *Suite) TestKernel2Vxlan2Kernel() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: alpine` + "\n" + ` labels:` + "\n" + ` app: alpine ` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://icmp-responder/nsm-1` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -72,9 +72,9 @@ func (s *Suite) TestMemif2Memif() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: memif://icmp-responder/nsm-1` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) diff --git a/suites/multiforwarder/suite.gen.go b/suites/multiforwarder/suite.gen.go index 1b72eb2d72..f9d7d959f9 100755 --- a/suites/multiforwarder/suite.gen.go +++ b/suites/multiforwarder/suite.gen.go @@ -28,7 +28,7 @@ func (s *Suite) SetupSuite() { r.Run(`WH=$(kubectl get pods -l app=admission-webhook-k8s -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `kubectl delete mutatingwebhookconfiguration ${WH}` + "\n" + `kubectl delete ns nsm-system`) }) r.Run(`kubectl create ns nsm-system`) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/multiforwarder?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/multiforwarder?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`WH=$(kubectl get pods -l app=admission-webhook-k8s -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `kubectl wait --for=condition=ready --timeout=1m pod ${WH} -n nsm-system`) } func (s *Suite) TestKernel2Kernel() { @@ -36,9 +36,9 @@ func (s *Suite) TestKernel2Kernel() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: alpine` + "\n" + ` labels:` + "\n" + ` app: alpine ` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://icmp-responder/nsm-1` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -56,12 +56,12 @@ func (s *Suite) TestKernel2Kernel_Vfio2Noop() { r.Run(`kubectl -n ${NAMESPACE} exec ${NSE_VFIO} --container ponger -- /bin/bash -c '\` + "\n" + ` sleep 10 && kill $(pgrep "pingpong") 1>/dev/null 2>&1 & \` + "\n" + `'`) r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) r.Run(`function mac_create(){` + "\n" + ` echo -n 00` + "\n" + ` dd bs=1 count=5 if=/dev/random 2>/dev/null | hexdump -v -e '/1 ":%02x"'` + "\n" + `}`) r.Run(`CLIENT_MAC=$(mac_create)` + "\n" + `echo Client MAC: ${CLIENT_MAC}`) r.Run(`SERVER_MAC=$(mac_create)` + "\n" + `echo Server MAC: ${SERVER_MAC}`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-vfio?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-vfio?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `- patch-nse-vfio.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-vfio?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-vfio?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `- patch-nse-vfio.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse-vfio.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-vfio` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: sidecar` + "\n" + ` env:` + "\n" + ` - name: NSM_SERVICES` + "\n" + ` value: "pingpong@worker.domain: { addr: ${SERVER_MAC} }"` + "\n" + ` - name: ponger` + "\n" + ` command: ["/bin/bash", "/root/scripts/pong.sh", "eno4", "31", ${SERVER_MAC}]` + "\n" + `EOF`) @@ -83,9 +83,9 @@ func (s *Suite) TestKernel2Vxlan2Kernel() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: alpine` + "\n" + ` labels:` + "\n" + ` app: alpine ` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://icmp-responder/nsm-1` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -103,12 +103,12 @@ func (s *Suite) TestKernel2Vxlan2Kernel_Vfio2Noop() { r.Run(`kubectl -n ${NAMESPACE} exec ${NSE_VFIO} --container ponger -- /bin/bash -c '\` + "\n" + ` sleep 10 && kill $(pgrep "pingpong") 1>/dev/null 2>&1 & \` + "\n" + `'`) r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) r.Run(`function mac_create(){` + "\n" + ` echo -n 00` + "\n" + ` dd bs=1 count=5 if=/dev/random 2>/dev/null | hexdump -v -e '/1 ":%02x"'` + "\n" + `}`) r.Run(`CLIENT_MAC=$(mac_create)` + "\n" + `echo Client MAC: ${CLIENT_MAC}`) r.Run(`SERVER_MAC=$(mac_create)` + "\n" + `echo Server MAC: ${SERVER_MAC}`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-vfio?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-vfio?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `- patch-nse-vfio.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-vfio?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-vfio?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `- patch-nse-vfio.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) r.Run(`cat > patch-nse-vfio.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-vfio` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: sidecar` + "\n" + ` env:` + "\n" + ` - name: NSM_SERVICES` + "\n" + ` value: "pingpong@worker.domain: { addr: ${SERVER_MAC} }"` + "\n" + ` - name: ponger` + "\n" + ` command: ["/bin/bash", "/root/scripts/pong.sh", "eno4", "31", ${SERVER_MAC}]` + "\n" + `EOF`) @@ -130,9 +130,9 @@ func (s *Suite) TestMemif2Memif() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: memif://icmp-responder/nsm-1` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-memif` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -148,8 +148,8 @@ func (s *Suite) TestSriovKernel2Noop() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel-ponger?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel-ponger?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1?sriovToken=worker.domain/10G` + "\n" + ` resources:` + "\n" + ` limits:` + "\n" + ` worker.domain/10G: 1` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_LABELS` + "\n" + ` value: serviceDomain:worker.domain` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` resources:` + "\n" + ` limits:` + "\n" + ` master.domain/10G: 1` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -166,12 +166,12 @@ func (s *Suite) TestVfio2Noop() { r.Run(`kubectl -n ${NAMESPACE} exec ${NSE} --container ponger -- /bin/bash -c '\` + "\n" + ` sleep 10 && kill $(pgrep "pingpong") 1>/dev/null 2>&1 & \` + "\n" + `'`) r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`function mac_create(){` + "\n" + ` echo -n 00` + "\n" + ` dd bs=1 count=5 if=/dev/random 2>/dev/null | hexdump -v -e '/1 ":%02x"'` + "\n" + `}`) r.Run(`CLIENT_MAC=$(mac_create)` + "\n" + `echo Client MAC: ${CLIENT_MAC}`) r.Run(`SERVER_MAC=$(mac_create)` + "\n" + `echo Server MAC: ${SERVER_MAC}`) r.Run(`cat > patch-nse-vfio.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-vfio` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: sidecar` + "\n" + ` env:` + "\n" + ` - name: NSM_SERVICES` + "\n" + ` value: "pingpong@worker.domain: { addr: ${SERVER_MAC} }"` + "\n" + ` - name: ponger` + "\n" + ` command: ["/bin/bash", "/root/scripts/pong.sh", "eno4", "31", ${SERVER_MAC}]` + "\n" + `EOF`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-vfio?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-vfio?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse-vfio.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-vfio?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-vfio?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse-vfio.yaml` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) r.Run(`kubectl -n ${NAMESPACE} wait --for=condition=ready --timeout=1m pod -l app=nsc-vfio`) r.Run(`kubectl -n ${NAMESPACE} wait --for=condition=ready --timeout=1m pod -l app=nse-vfio`) diff --git a/suites/observability/suite.gen.go b/suites/observability/suite.gen.go index 59774ae6d0..f423be044e 100755 --- a/suites/observability/suite.gen.go +++ b/suites/observability/suite.gen.go @@ -31,15 +31,15 @@ func (s *Suite) TestJaeger_and_prometheus() { r.Run(`WH=$(kubectl get pods -l app=admission-webhook-k8s -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `kubectl delete mutatingwebhookconfiguration ${WH}` + "\n" + `kubectl delete ns nsm-system`) r.Run(`kubectl describe pods -n observability` + "\n" + `kubectl delete ns observability` + "\n" + `pkill -f "port-forward"`) }) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/observability/jaeger-and-prometheus?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/observability/jaeger-and-prometheus?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`kubectl wait -n observability --timeout=1m --for=condition=ready pod -l app=opentelemetry`) r.Run(`kubectl create ns nsm-system`) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/observability/jaeger-and-prometheus/nsm-system?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/observability/jaeger-and-prometheus/nsm-system?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`WH=$(kubectl get pods -l app=admission-webhook-k8s -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `kubectl wait --for=condition=ready --timeout=1m pod ${WH} -n nsm-system`) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) r.Run(`mkdir example`) - r.Run(`cat > example/kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > example/kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > example/client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: alpine` + "\n" + ` labels:` + "\n" + ` app: alpine ` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://icmp-responder/nsm-1` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > example/patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` - name: TELEMETRY` + "\n" + ` value: "true"` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k example`) diff --git a/suites/ovs/suite.gen.go b/suites/ovs/suite.gen.go index 676c78f140..d212435851 100755 --- a/suites/ovs/suite.gen.go +++ b/suites/ovs/suite.gen.go @@ -28,7 +28,7 @@ func (s *Suite) SetupSuite() { r.Run(`WH=$(kubectl get pods -l app=admission-webhook-k8s -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `kubectl delete mutatingwebhookconfiguration ${WH}` + "\n" + `kubectl delete ns nsm-system`) }) r.Run(`kubectl create ns nsm-system`) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/ovs?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/ovs?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`WH=$(kubectl get pods -l app=admission-webhook-k8s -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `kubectl wait --for=condition=ready --timeout=1m pod ${WH} -n nsm-system`) } func (s *Suite) TestWebhook_smartvf() { @@ -37,11 +37,11 @@ func (s *Suite) TestWebhook_smartvf() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) r.Run(`WH=$(kubectl get pods -l app=admission-webhook-k8s -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `kubectl wait --for=condition=ready --timeout=1m pod ${WH} -n nsm-system`) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/features/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))`) r.Run(`cat > postgres-cl.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: postgres-cl` + "\n" + ` annotations:` + "\n" + ` # Add in the sriovToken label your own SmartVF interface pool` + "\n" + ` networkservicemesh.io: kernel://my-postgres-service/nsm-1?sriovToken=worker.domain/100G` + "\n" + ` labels:` + "\n" + ` app: postgres-cl` + "\n" + ` "spiffe.io/spiffe-id": "true"` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: postgres-cl` + "\n" + ` image: postgres` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` env:` + "\n" + ` - name: POSTGRES_HOST_AUTH_METHOD` + "\n" + ` value: trust` + "\n" + ` nodeName: ${NODES[0]}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: postgres` + "\n" + ` image: postgres` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` ports:` + "\n" + ` - containerPort: 5432` + "\n" + ` env:` + "\n" + ` - name: POSTGRES_DB` + "\n" + ` value: test` + "\n" + ` - name: POSTGRES_USER` + "\n" + ` value: admin` + "\n" + ` - name: POSTGRES_PASSWORD` + "\n" + ` value: admin` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_LABELS` + "\n" + ` # Add your own serviceDomain` + "\n" + ` value: serviceDomain:worker.domain` + "\n" + ` - name: NSM_SERVICE_NAMES` + "\n" + ` value: my-postgres-service` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` resources:` + "\n" + ` limits:` + "\n" + ` # Add your own SmartVF interface pool` + "\n" + ` worker.domain/100G: 1` + "\n" + ` nodeName: ${NODES[1]}` + "\n" + `EOF`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `resources:` + "\n" + `- postgres-cl.yaml` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `resources:` + "\n" + `- postgres-cl.yaml` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) r.Run(`kubectl wait --for=condition=ready --timeout=5m pod -l app=nse-kernel -n ${NAMESPACE}`) r.Run(`kubectl wait --for=condition=ready --timeout=1m pod postgres-cl -n ${NAMESPACE}`) @@ -54,9 +54,9 @@ func (s *Suite) TestKernel2Kernel() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources: ` + "\n" + `- client.yaml` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: v1` + "\n" + `kind: Pod` + "\n" + `metadata:` + "\n" + ` name: alpine` + "\n" + ` labels:` + "\n" + ` app: alpine ` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://icmp-responder/nsm-1` + "\n" + `spec:` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -72,9 +72,9 @@ func (s *Suite) TestKernel2KernelVLAN() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`NODE=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}')[0])`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-vlan-vpp?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-vlan-vpp?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` replicas: 2` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://vlan-vpp-responder/nsm-1` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/30` + "\n" + ` nodeName: ${NODE}` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -89,8 +89,8 @@ func (s *Suite) TestSmartVF2SmartVF() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1?sriovToken=worker.domain/100G` + "\n" + ` resources:` + "\n" + ` limits:` + "\n" + ` worker.domain/100G: 1` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_LABELS` + "\n" + ` value: serviceDomain:worker.domain` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` resources:` + "\n" + ` limits:` + "\n" + ` worker.domain/100G: 1` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) diff --git a/suites/remotevlan/rvlanovs/suite.gen.go b/suites/remotevlan/rvlanovs/suite.gen.go index c18f8992e0..1c3aa74d4a 100755 --- a/suites/remotevlan/rvlanovs/suite.gen.go +++ b/suites/remotevlan/rvlanovs/suite.gen.go @@ -23,9 +23,9 @@ func (s *Suite) SetupSuite() { } r := s.Runner("../deployments-k8s/examples/remotevlan/rvlanovs") s.T().Cleanup(func() { - r.Run(`kubectl delete -k https://github.com/networkservicemesh/deployments-k8s/examples/remotevlan/rvlanovs?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl delete -k https://github.com/networkservicemesh/deployments-k8s/examples/remotevlan/rvlanovs?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) }) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/remotevlan/rvlanovs?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/remotevlan/rvlanovs?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`kubectl -n nsm-system wait --for=condition=ready --timeout=2m pod -l app=forwarder-ovs`) } func (s *Suite) TestKernel2RVlanBreakout() { @@ -34,7 +34,7 @@ func (s *Suite) TestKernel2RVlanBreakout() { r.Run(`docker stop rvm-tester` + "\n" + `docker image rm rvm-tester:latest` + "\n" + `true`) r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`cat > first-iperf-s.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: iperf1-s` + "\n" + ` labels:` + "\n" + ` app: iperf1-s` + "\n" + `spec:` + "\n" + ` replicas: 2` + "\n" + ` selector:` + "\n" + ` matchLabels:` + "\n" + ` app: iperf1-s` + "\n" + ` template:` + "\n" + ` metadata:` + "\n" + ` labels:` + "\n" + ` app: iperf1-s` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://finance-bridge/nsm-1` + "\n" + ` spec:` + "\n" + ` affinity:` + "\n" + ` podAntiAffinity:` + "\n" + ` requiredDuringSchedulingIgnoredDuringExecution:` + "\n" + ` - labelSelector:` + "\n" + ` matchExpressions:` + "\n" + ` - key: app` + "\n" + ` operator: In` + "\n" + ` values:` + "\n" + ` - iperf1-s` + "\n" + ` topologyKey: "kubernetes.io/hostname"` + "\n" + ` containers:` + "\n" + ` - name: iperf-server` + "\n" + ` image: networkstatic/iperf3:latest` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` command: ["tail", "-f", "/dev/null"]` + "\n" + `EOF`) r.Run(`kubectl apply -n ${NAMESPACE} -f ./first-iperf-s.yaml`) r.Run(`kubectl -n ${NAMESPACE} wait --for=condition=ready --timeout=1m pod -l app=iperf1-s`) @@ -51,7 +51,7 @@ func (s *Suite) TestKernel2RVlanInternal() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`cat > first-iperf-s.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: iperf1-s` + "\n" + ` labels:` + "\n" + ` app: iperf1-s` + "\n" + `spec:` + "\n" + ` replicas: 2` + "\n" + ` selector:` + "\n" + ` matchLabels:` + "\n" + ` app: iperf1-s` + "\n" + ` template:` + "\n" + ` metadata:` + "\n" + ` labels:` + "\n" + ` app: iperf1-s` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://finance-bridge/nsm-1` + "\n" + ` spec:` + "\n" + ` affinity:` + "\n" + ` podAntiAffinity:` + "\n" + ` requiredDuringSchedulingIgnoredDuringExecution:` + "\n" + ` - labelSelector:` + "\n" + ` matchExpressions:` + "\n" + ` - key: app` + "\n" + ` operator: In` + "\n" + ` values:` + "\n" + ` - iperf1-s` + "\n" + ` topologyKey: "kubernetes.io/hostname"` + "\n" + ` containers:` + "\n" + ` - name: iperf-server` + "\n" + ` image: networkstatic/iperf3:latest` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` command: ["tail", "-f", "/dev/null"]` + "\n" + `EOF`) r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources:` + "\n" + `- first-iperf-s.yaml` + "\n" + `` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -71,7 +71,7 @@ func (s *Suite) TestKernel2RVlanMultiNS() { r.Run(`kubectl delete ns ${SECOND_NAMESPACE}`) r.Run(`rm -rf ns-1 ns-2`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `FIRST_NAMESPACE=${NAMESPACE:10}` + "\n" + `NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `SECOND_NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `FIRST_NAMESPACE=${NAMESPACE:10}` + "\n" + `NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `SECOND_NAMESPACE=${NAMESPACE:10}`) r.Run(`mkdir -p ns-1 ns-2`) r.Run(`cat > ns-1/first-client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: alpine-1` + "\n" + ` labels:` + "\n" + ` app: alpine-1` + "\n" + `spec:` + "\n" + ` replicas: 2` + "\n" + ` selector:` + "\n" + ` matchLabels:` + "\n" + ` app: alpine-1` + "\n" + ` template:` + "\n" + ` metadata:` + "\n" + ` labels:` + "\n" + ` app: alpine-1` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://private-bridge.${FIRST_NAMESPACE}/nsm-1` + "\n" + ` spec:` + "\n" + ` affinity:` + "\n" + ` podAntiAffinity:` + "\n" + ` requiredDuringSchedulingIgnoredDuringExecution:` + "\n" + ` - labelSelector:` + "\n" + ` matchExpressions:` + "\n" + ` - key: app` + "\n" + ` operator: In` + "\n" + ` values:` + "\n" + ` - alpine-1` + "\n" + ` topologyKey: "kubernetes.io/hostname"` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + `EOF`) r.Run(`cat > ns-1/patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-remote-vlan` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CONNECT_TO` + "\n" + ` value: "registry.nsm-system:5002"` + "\n" + ` - name: NSM_SERVICES` + "\n" + ` value: "private-bridge.${FIRST_NAMESPACE} { vlan: 0; via: gw1 }"` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.10.1.0/24` + "\n" + `EOF`) @@ -79,7 +79,7 @@ func (s *Suite) TestKernel2RVlanMultiNS() { r.Run(`kubectl apply -k ./ns-1`) r.Run(`cat > ns-2/second-client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: alpine-2` + "\n" + ` labels:` + "\n" + ` app: alpine-2` + "\n" + `spec:` + "\n" + ` replicas: 2` + "\n" + ` selector:` + "\n" + ` matchLabels:` + "\n" + ` app: alpine-2` + "\n" + ` template:` + "\n" + ` metadata:` + "\n" + ` labels:` + "\n" + ` app: alpine-2` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://blue-bridge.${SECOND_NAMESPACE}/nsm-1` + "\n" + ` spec:` + "\n" + ` affinity:` + "\n" + ` podAntiAffinity:` + "\n" + ` requiredDuringSchedulingIgnoredDuringExecution:` + "\n" + ` - labelSelector:` + "\n" + ` matchExpressions:` + "\n" + ` - key: app` + "\n" + ` operator: In` + "\n" + ` values:` + "\n" + ` - alpine-2` + "\n" + ` topologyKey: "kubernetes.io/hostname"` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + `EOF` + "\n" + `cat > ns-2/third-client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: alpine-3` + "\n" + ` labels:` + "\n" + ` app: alpine-3` + "\n" + `spec:` + "\n" + ` replicas: 2` + "\n" + ` selector:` + "\n" + ` matchLabels:` + "\n" + ` app: alpine-3` + "\n" + ` template:` + "\n" + ` metadata:` + "\n" + ` labels:` + "\n" + ` app: alpine-3` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://green-bridge.${SECOND_NAMESPACE}/nsm-1` + "\n" + ` spec:` + "\n" + ` affinity:` + "\n" + ` podAntiAffinity:` + "\n" + ` requiredDuringSchedulingIgnoredDuringExecution:` + "\n" + ` - labelSelector:` + "\n" + ` matchExpressions:` + "\n" + ` - key: app` + "\n" + ` operator: In` + "\n" + ` values:` + "\n" + ` - alpine-3` + "\n" + ` topologyKey: "kubernetes.io/hostname"` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + `EOF`) r.Run(`cat > ns-2/patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-remote-vlan` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CONNECT_TO` + "\n" + ` value: "registry.nsm-system:5002"` + "\n" + ` - name: NSM_SERVICES` + "\n" + ` value: "blue-bridge.${SECOND_NAMESPACE} { vlan: 300; via: gw1 }, green-bridge.${SECOND_NAMESPACE} { vlan: 400; via: gw1 }"` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.10.2.0/24` + "\n" + `EOF`) - r.Run(`cat > ns-2/kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${SECOND_NAMESPACE}` + "\n" + `` + "\n" + `resources:` + "\n" + `- second-client.yaml` + "\n" + `- third-client.yaml` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-remote-vlan?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `nameSuffix: -bg` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > ns-2/kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${SECOND_NAMESPACE}` + "\n" + `` + "\n" + `resources:` + "\n" + `- second-client.yaml` + "\n" + `- third-client.yaml` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-remote-vlan?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `nameSuffix: -bg` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`kubectl apply -k ./ns-2`) r.Run(`cat > client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: alpine-4` + "\n" + ` labels:` + "\n" + ` app: alpine-4` + "\n" + `spec:` + "\n" + ` replicas: 2` + "\n" + ` selector:` + "\n" + ` matchLabels:` + "\n" + ` app: alpine-4` + "\n" + ` template:` + "\n" + ` metadata:` + "\n" + ` labels:` + "\n" + ` app: alpine-4` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://finance-bridge/nsm-1` + "\n" + ` spec:` + "\n" + ` affinity:` + "\n" + ` podAntiAffinity:` + "\n" + ` requiredDuringSchedulingIgnoredDuringExecution:` + "\n" + ` - labelSelector:` + "\n" + ` matchExpressions:` + "\n" + ` - key: app` + "\n" + ` operator: In` + "\n" + ` values:` + "\n" + ` - alpine-4` + "\n" + ` topologyKey: "kubernetes.io/hostname"` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + `EOF`) r.Run(`kubectl apply -n nsm-system -f client.yaml`) diff --git a/suites/remotevlan/rvlanvpp/suite.gen.go b/suites/remotevlan/rvlanvpp/suite.gen.go index 826902349d..d24ebfb1f9 100755 --- a/suites/remotevlan/rvlanvpp/suite.gen.go +++ b/suites/remotevlan/rvlanvpp/suite.gen.go @@ -23,9 +23,9 @@ func (s *Suite) SetupSuite() { } r := s.Runner("../deployments-k8s/examples/remotevlan/rvlanvpp") s.T().Cleanup(func() { - r.Run(`kubectl delete -k https://github.com/networkservicemesh/deployments-k8s/examples/remotevlan/rvlanvpp?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl delete -k https://github.com/networkservicemesh/deployments-k8s/examples/remotevlan/rvlanvpp?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) }) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/remotevlan/rvlanvpp?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/remotevlan/rvlanvpp?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`kubectl -n nsm-system wait --for=condition=ready --timeout=2m pod -l app=forwarder-vpp`) } func (s *Suite) TestKernel2RVlanBreakout() { @@ -34,7 +34,7 @@ func (s *Suite) TestKernel2RVlanBreakout() { r.Run(`docker stop rvm-tester` + "\n" + `docker image rm rvm-tester:latest` + "\n" + `true`) r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`cat > first-iperf-s.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: iperf1-s` + "\n" + ` labels:` + "\n" + ` app: iperf1-s` + "\n" + `spec:` + "\n" + ` replicas: 2` + "\n" + ` selector:` + "\n" + ` matchLabels:` + "\n" + ` app: iperf1-s` + "\n" + ` template:` + "\n" + ` metadata:` + "\n" + ` labels:` + "\n" + ` app: iperf1-s` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://finance-bridge/nsm-1` + "\n" + ` spec:` + "\n" + ` affinity:` + "\n" + ` podAntiAffinity:` + "\n" + ` requiredDuringSchedulingIgnoredDuringExecution:` + "\n" + ` - labelSelector:` + "\n" + ` matchExpressions:` + "\n" + ` - key: app` + "\n" + ` operator: In` + "\n" + ` values:` + "\n" + ` - iperf1-s` + "\n" + ` topologyKey: "kubernetes.io/hostname"` + "\n" + ` containers:` + "\n" + ` - name: iperf-server` + "\n" + ` image: networkstatic/iperf3:latest` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` command: ["tail", "-f", "/dev/null"]` + "\n" + `EOF`) r.Run(`kubectl apply -n ${NAMESPACE} -f ./first-iperf-s.yaml`) r.Run(`kubectl -n ${NAMESPACE} wait --for=condition=ready --timeout=1m pod -l app=iperf1-s`) @@ -51,7 +51,7 @@ func (s *Suite) TestKernel2RVlanInternal() { s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`cat > first-iperf-s.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: iperf1-s` + "\n" + ` labels:` + "\n" + ` app: iperf1-s` + "\n" + `spec:` + "\n" + ` replicas: 2` + "\n" + ` selector:` + "\n" + ` matchLabels:` + "\n" + ` app: iperf1-s` + "\n" + ` template:` + "\n" + ` metadata:` + "\n" + ` labels:` + "\n" + ` app: iperf1-s` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://finance-bridge/nsm-1` + "\n" + ` spec:` + "\n" + ` affinity:` + "\n" + ` podAntiAffinity:` + "\n" + ` requiredDuringSchedulingIgnoredDuringExecution:` + "\n" + ` - labelSelector:` + "\n" + ` matchExpressions:` + "\n" + ` - key: app` + "\n" + ` operator: In` + "\n" + ` values:` + "\n" + ` - iperf1-s` + "\n" + ` topologyKey: "kubernetes.io/hostname"` + "\n" + ` containers:` + "\n" + ` - name: iperf-server` + "\n" + ` image: networkstatic/iperf3:latest` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` command: ["tail", "-f", "/dev/null"]` + "\n" + `EOF`) r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `resources:` + "\n" + `- first-iperf-s.yaml` + "\n" + `` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -71,7 +71,7 @@ func (s *Suite) TestKernel2RVlanMultiNS() { r.Run(`kubectl delete ns ${SECOND_NAMESPACE}`) r.Run(`rm -rf ns-1 ns-2`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `FIRST_NAMESPACE=${NAMESPACE:10}` + "\n" + `NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `SECOND_NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `FIRST_NAMESPACE=${NAMESPACE:10}` + "\n" + `NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `SECOND_NAMESPACE=${NAMESPACE:10}`) r.Run(`mkdir -p ns-1 ns-2`) r.Run(`cat > ns-1/first-client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: alpine-1` + "\n" + ` labels:` + "\n" + ` app: alpine-1` + "\n" + `spec:` + "\n" + ` replicas: 2` + "\n" + ` selector:` + "\n" + ` matchLabels:` + "\n" + ` app: alpine-1` + "\n" + ` template:` + "\n" + ` metadata:` + "\n" + ` labels:` + "\n" + ` app: alpine-1` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://private-bridge.${FIRST_NAMESPACE}/nsm-1` + "\n" + ` spec:` + "\n" + ` affinity:` + "\n" + ` podAntiAffinity:` + "\n" + ` requiredDuringSchedulingIgnoredDuringExecution:` + "\n" + ` - labelSelector:` + "\n" + ` matchExpressions:` + "\n" + ` - key: app` + "\n" + ` operator: In` + "\n" + ` values:` + "\n" + ` - alpine-1` + "\n" + ` topologyKey: "kubernetes.io/hostname"` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + `EOF`) r.Run(`cat > ns-1/patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-remote-vlan` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CONNECT_TO` + "\n" + ` value: "registry.nsm-system:5002"` + "\n" + ` - name: NSM_SERVICES` + "\n" + ` value: "private-bridge.${FIRST_NAMESPACE} { vlan: 0; via: gw1 }"` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.10.1.0/24` + "\n" + `EOF`) @@ -79,7 +79,7 @@ func (s *Suite) TestKernel2RVlanMultiNS() { r.Run(`kubectl apply -k ./ns-1`) r.Run(`cat > ns-2/second-client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: alpine-2` + "\n" + ` labels:` + "\n" + ` app: alpine-2` + "\n" + `spec:` + "\n" + ` replicas: 2` + "\n" + ` selector:` + "\n" + ` matchLabels:` + "\n" + ` app: alpine-2` + "\n" + ` template:` + "\n" + ` metadata:` + "\n" + ` labels:` + "\n" + ` app: alpine-2` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://blue-bridge.${SECOND_NAMESPACE}/nsm-1` + "\n" + ` spec:` + "\n" + ` affinity:` + "\n" + ` podAntiAffinity:` + "\n" + ` requiredDuringSchedulingIgnoredDuringExecution:` + "\n" + ` - labelSelector:` + "\n" + ` matchExpressions:` + "\n" + ` - key: app` + "\n" + ` operator: In` + "\n" + ` values:` + "\n" + ` - alpine-2` + "\n" + ` topologyKey: "kubernetes.io/hostname"` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + `EOF` + "\n" + `cat > ns-2/third-client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: alpine-3` + "\n" + ` labels:` + "\n" + ` app: alpine-3` + "\n" + `spec:` + "\n" + ` replicas: 2` + "\n" + ` selector:` + "\n" + ` matchLabels:` + "\n" + ` app: alpine-3` + "\n" + ` template:` + "\n" + ` metadata:` + "\n" + ` labels:` + "\n" + ` app: alpine-3` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://green-bridge.${SECOND_NAMESPACE}/nsm-1` + "\n" + ` spec:` + "\n" + ` affinity:` + "\n" + ` podAntiAffinity:` + "\n" + ` requiredDuringSchedulingIgnoredDuringExecution:` + "\n" + ` - labelSelector:` + "\n" + ` matchExpressions:` + "\n" + ` - key: app` + "\n" + ` operator: In` + "\n" + ` values:` + "\n" + ` - alpine-3` + "\n" + ` topologyKey: "kubernetes.io/hostname"` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + `EOF`) r.Run(`cat > ns-2/patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-remote-vlan` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_CONNECT_TO` + "\n" + ` value: "registry.nsm-system:5002"` + "\n" + ` - name: NSM_SERVICES` + "\n" + ` value: "blue-bridge.${SECOND_NAMESPACE} { vlan: 300; via: gw1 }, green-bridge.${SECOND_NAMESPACE} { vlan: 400; via: gw1 }"` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.10.2.0/24` + "\n" + `EOF`) - r.Run(`cat > ns-2/kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${SECOND_NAMESPACE}` + "\n" + `` + "\n" + `resources:` + "\n" + `- second-client.yaml` + "\n" + `- third-client.yaml` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-remote-vlan?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `nameSuffix: -bg` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`cat > ns-2/kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${SECOND_NAMESPACE}` + "\n" + `` + "\n" + `resources:` + "\n" + `- second-client.yaml` + "\n" + `- third-client.yaml` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-remote-vlan?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `nameSuffix: -bg` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`kubectl apply -k ./ns-2`) r.Run(`cat > client.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: alpine-4` + "\n" + ` labels:` + "\n" + ` app: alpine-4` + "\n" + `spec:` + "\n" + ` replicas: 2` + "\n" + ` selector:` + "\n" + ` matchLabels:` + "\n" + ` app: alpine-4` + "\n" + ` template:` + "\n" + ` metadata:` + "\n" + ` labels:` + "\n" + ` app: alpine-4` + "\n" + ` annotations:` + "\n" + ` networkservicemesh.io: kernel://finance-bridge/nsm-1` + "\n" + ` spec:` + "\n" + ` affinity:` + "\n" + ` podAntiAffinity:` + "\n" + ` requiredDuringSchedulingIgnoredDuringExecution:` + "\n" + ` - labelSelector:` + "\n" + ` matchExpressions:` + "\n" + ` - key: app` + "\n" + ` operator: In` + "\n" + ` values:` + "\n" + ` - alpine-4` + "\n" + ` topologyKey: "kubernetes.io/hostname"` + "\n" + ` containers:` + "\n" + ` - name: alpine` + "\n" + ` image: alpine:3.15.0` + "\n" + ` imagePullPolicy: IfNotPresent` + "\n" + ` stdin: true` + "\n" + ` tty: true` + "\n" + `EOF`) r.Run(`kubectl apply -n nsm-system -f client.yaml`) diff --git a/suites/spire/suite.gen.go b/suites/spire/suite.gen.go index 4b5552c4c5..92bf170e49 100755 --- a/suites/spire/suite.gen.go +++ b/suites/spire/suite.gen.go @@ -25,7 +25,7 @@ func (s *Suite) SetupSuite() { s.T().Cleanup(func() { r.Run(`kubectl delete crd spiffeids.spiffeid.spiffe.io` + "\n" + `kubectl delete ns spire`) }) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/spire?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/spire?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) r.Run(`kubectl wait -n spire --timeout=2m --for=condition=ready pod -l app=spire-agent`) r.Run(`kubectl wait -n spire --timeout=1m --for=condition=ready pod -l app=spire-server`) } diff --git a/suites/sriov/suite.gen.go b/suites/sriov/suite.gen.go index 3aebd6a59f..51b1afcba9 100755 --- a/suites/sriov/suite.gen.go +++ b/suites/sriov/suite.gen.go @@ -28,15 +28,15 @@ func (s *Suite) SetupSuite() { r.Run(`WH=$(kubectl get pods -l app=admission-webhook-k8s -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')` + "\n" + `kubectl delete mutatingwebhookconfiguration ${WH}` + "\n" + `kubectl delete ns nsm-system`) }) r.Run(`kubectl create ns nsm-system`) - r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/sriov?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf`) + r.Run(`kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/sriov?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a`) } func (s *Suite) TestSriovKernel2Noop() { r := s.Runner("../deployments-k8s/examples/use-cases/SriovKernel2Noop") s.T().Cleanup(func() { r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel-ponger?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel-ponger?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nsc.yaml` + "\n" + `- patch-nse.yaml` + "\n" + `EOF`) r.Run(`cat > patch-nsc.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nsc-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nsc` + "\n" + ` env:` + "\n" + ` - name: NSM_NETWORK_SERVICES` + "\n" + ` value: kernel://icmp-responder/nsm-1?sriovToken=worker.domain/10G` + "\n" + ` resources:` + "\n" + ` limits:` + "\n" + ` worker.domain/10G: 1` + "\n" + `EOF`) r.Run(`cat > patch-nse.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-kernel` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: nse` + "\n" + ` env:` + "\n" + ` - name: NSM_LABELS` + "\n" + ` value: serviceDomain:worker.domain` + "\n" + ` - name: NSM_CIDR_PREFIX` + "\n" + ` value: 172.16.1.100/31` + "\n" + ` resources:` + "\n" + ` limits:` + "\n" + ` master.domain/10G: 1` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) @@ -53,12 +53,12 @@ func (s *Suite) TestVfio2Noop() { r.Run(`kubectl -n ${NAMESPACE} exec ${NSE} --container ponger -- /bin/bash -c '\` + "\n" + ` sleep 10 && kill $(pgrep "pingpong") 1>/dev/null 2>&1 & \` + "\n" + `'`) r.Run(`kubectl delete ns ${NAMESPACE}`) }) - r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/49b796b3fac61f2ca634386eb686b0ebcaee6abf/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) + r.Run(`NAMESPACE=($(kubectl create -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/a7c973d7909454ce8e56c9f82e9e212b487f027a/examples/use-cases/namespace.yaml)[0])` + "\n" + `NAMESPACE=${NAMESPACE:10}`) r.Run(`function mac_create(){` + "\n" + ` echo -n 00` + "\n" + ` dd bs=1 count=5 if=/dev/random 2>/dev/null | hexdump -v -e '/1 ":%02x"'` + "\n" + `}`) r.Run(`CLIENT_MAC=$(mac_create)` + "\n" + `echo Client MAC: ${CLIENT_MAC}`) r.Run(`SERVER_MAC=$(mac_create)` + "\n" + `echo Server MAC: ${SERVER_MAC}`) r.Run(`cat > patch-nse-vfio.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: apps/v1` + "\n" + `kind: Deployment` + "\n" + `metadata:` + "\n" + ` name: nse-vfio` + "\n" + `spec:` + "\n" + ` template:` + "\n" + ` spec:` + "\n" + ` containers:` + "\n" + ` - name: sidecar` + "\n" + ` env:` + "\n" + ` - name: NSM_SERVICES` + "\n" + ` value: "pingpong@worker.domain: { addr: ${SERVER_MAC} }"` + "\n" + ` - name: ponger` + "\n" + ` command: ["/bin/bash", "/root/scripts/pong.sh", "eno4", "31", ${SERVER_MAC}]` + "\n" + `EOF`) - r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-vfio?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-vfio?ref=49b796b3fac61f2ca634386eb686b0ebcaee6abf` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse-vfio.yaml` + "\n" + `EOF`) + r.Run(`cat > kustomization.yaml <<EOF` + "\n" + `---` + "\n" + `apiVersion: kustomize.config.k8s.io/v1beta1` + "\n" + `kind: Kustomization` + "\n" + `` + "\n" + `namespace: ${NAMESPACE}` + "\n" + `` + "\n" + `bases:` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-vfio?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `- https://github.com/networkservicemesh/deployments-k8s/apps/nse-vfio?ref=a7c973d7909454ce8e56c9f82e9e212b487f027a` + "\n" + `` + "\n" + `patchesStrategicMerge:` + "\n" + `- patch-nse-vfio.yaml` + "\n" + `EOF`) r.Run(`kubectl apply -k .`) r.Run(`kubectl -n ${NAMESPACE} wait --for=condition=ready --timeout=1m pod -l app=nsc-vfio`) r.Run(`kubectl -n ${NAMESPACE} wait --for=condition=ready --timeout=1m pod -l app=nse-vfio`)