kuryr-kubernetes/kubernetes_crds/kuryr_crds/kuryrnetworkpolicy.yaml
Michał Dulko a1708e1c76 KuryrNetworkPolicy CRD
This commit is a huge refactoring of how we handle network policies. In
general:

* KuryrNetPolicy is replaced by KuryrNetworkPolicy. The upgrade path
  is handled in the constructor of KuryrNetworkPolicyHandler.
* New CRD has spec and status properties. spec is always populated by
  NetworkPolicyHandler. status is handled by KuryrNetworkPolicyHandler.
  This means that in order to trigger SG rules recalculation on Pod ang
  Service events, the NetworkPolicy is "bumped" with a dummy annotation.
* NetworkPolicyHandler injects finalizers onto NetworkPolicy and
  KuryrNetworkPolicy objects, so that objects cannot get removed before
  KuryrNetworkPolicyHandler won't process deletion correctly.

Depends-On: https://review.opendev.org/742209
Change-Id: Iafc982e590ada0cd9d82e922c103583e4304e9ce
2020-07-31 14:44:15 +02:00

159 lines
4.8 KiB
YAML

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: kuryrnetworkpolicies.openstack.org
spec:
group: openstack.org
scope: Namespaced
names:
plural: kuryrnetworkpolicies
singular: kuryrnetworkpolicy
kind: KuryrNetworkPolicy
shortNames:
- knp
versions:
- name: v1
served: true
storage: true
additionalPrinterColumns:
- name: SG-ID
type: string
description: The ID of the SG associated to the policy
jsonPath: .status.securityGroupId
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
schema:
openAPIV3Schema:
type: object
required:
- status
- spec
properties:
spec:
type: object
required:
- egressSgRules
- ingressSgRules
- podSelector
- policyTypes
properties:
egressSgRules:
type: array
items:
type: object
required:
- sgRule
properties:
affectedPods:
type: array
items:
type: object
properties:
podIP:
type: string
podNamespace:
type: string
required:
- podIP
- podNamespace
namespace:
type: string
sgRule:
type: object
properties:
description:
type: string
direction:
type: string
ethertype:
type: string
port_range_max:
type: integer
port_range_min:
type: integer
protocol:
type: string
remote_ip_prefix:
type: string
ingressSgRules:
type: array
items:
type: object
required:
- sgRule
properties:
affectedPods:
type: array
items:
type: object
properties:
podIP:
type: string
podNamespace:
type: string
required:
- podIP
- podNamespace
namespace:
type: string
sgRule:
type: object
properties:
description:
type: string
direction:
type: string
ethertype:
type: string
port_range_max:
type: integer
port_range_min:
type: integer
protocol:
type: string
remote_ip_prefix:
type: string
podSelector:
x-kubernetes-preserve-unknown-fields: true
type: object
policyTypes:
type: array
items:
type: string
status:
type: object
required:
- securityGroupRules
properties:
securityGroupId:
type: string
securityGroupRules:
type: array
items:
type: object
required:
- id
properties:
id:
type: string
description:
type: string
direction:
type: string
ethertype:
type: string
port_range_max:
type: integer
port_range_min:
type: integer
protocol:
type: string
remote_ip_prefix:
type: string
security_group_id:
type: string
podSelector:
x-kubernetes-preserve-unknown-fields: true
type: object