Skip to content

Adds annotations to CiliumNetworkPolicies

Zamir Martins requested to merge add_annotation_to_cilium_network_policies into master

What does this MR do?

Adds annotations to CiliumNetworkPolicies. This MR adds annotations as part of metadata for CiliumNetworkPolicies wrapper. With this change policy editor can send annotations as part of the payload when creating/updating network policies.

It unblocks the following issue: #238484 (closed)

Example of the outcome of this change within the cluster:

$ kubectl get ciliumnetworkpolicy -n network-policy-demo-20-production test-annotations -o yaml
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
  annotations:
    app.gitlab.com/alert: "true"
  creationTimestamp: "2020-12-24T19:38:03Z"
  generation: 1
  name: test-annotations
  namespace: network-policy-demo-20-production
  resourceVersion: "30992"
  selfLink: /apis/cilium.io/v2/namespaces/network-policy-demo-20-production/ciliumnetworkpolicies/test-annotations
  uid: 24b2cb3f-244e-4249-a85d-ef8a59a7d302
spec:
  endpointSelector:
    matchLabels:
      network-policy.gitlab.com/disabled_by: gitlab

Screenshots (strongly suggested)

Police editor

Screen_Shot_2020-12-24_at_2.38.00_PM

Police drawer

Screen_Shot_2020-12-24_at_2.38.22_PM

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Zamir Martins

Merge request reports