Skip to content

Commit

Permalink
test: Add HTTP visibility annotation to echo-other-node
Browse files Browse the repository at this point in the history
Add HTTP visibility annotation to the echo-other-node pod. With a new
enough Cilium agent those annotations will show also when
echo-other-node has an ingress policy. Test behavior is not changed,
but we could change to verify the additional visibility when Cilium
agent with the visibility annotation is released.

To see the annotations use e.g.:

$ cilium connectivity test --test echo --print-flows --debug

Signed-off-by: Jarno Rajahalme <[email protected]>
  • Loading branch information
jrajahalme committed Jun 14, 2021
1 parent df1bbc1 commit 07a161d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions connectivity/check/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ type deploymentParameters struct {
Affinity *corev1.Affinity
ReadinessProbe *corev1.Probe
Labels map[string]string
Annotations map[string]string
}

func newDeployment(p deploymentParameters) *appsv1.Deployment {
Expand All @@ -71,6 +72,7 @@ func newDeployment(p deploymentParameters) *appsv1.Deployment {
"name": p.Name,
"kind": p.Kind,
},
Annotations: make(map[string]string, len(p.Annotations)),
},
Spec: corev1.PodSpec{
Containers: []corev1.Container{
Expand Down Expand Up @@ -104,6 +106,9 @@ func newDeployment(p deploymentParameters) *appsv1.Deployment {
for k, v := range p.Labels {
dep.Spec.Template.ObjectMeta.Labels[k] = v
}
for k, v := range p.Annotations {
dep.Spec.Template.ObjectMeta.Annotations[k] = v
}

return dep
}
Expand Down Expand Up @@ -310,6 +315,7 @@ func (ct *ConnectivityTest) deploy(ctx context.Context) error {
},
},
ReadinessProbe: newLocalReadinessProbe(8080, "/"),
Annotations: map[string]string{"io.cilium.proxy-visibility": "<Ingress/8080/TCP/HTTP>"},
})

_, err = ct.clients.dst.CreateDeployment(ctx, ct.params.TestNamespace, echoOtherNodeDeployment, metav1.CreateOptions{})
Expand Down

0 comments on commit 07a161d

Please sign in to comment.