Skip to content

Commit

Permalink
k8s: add Network Policies
Browse files Browse the repository at this point in the history
  • Loading branch information
trehn committed Apr 25, 2018
1 parent e3c42e9 commit fe53903
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions bundlewrap/items/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,22 @@ def get_auto_deps(self, items):
return []


class KubernetesNetworkPolicy(KubernetesItem):
BUNDLE_ATTRIBUTE_NAME = "k8s_networkpolicies"
KIND = "NetworkPolicy"
KUBERNETES_APIVERSION = "networking.k8s.io/v1"
ITEM_TYPE_NAME = "k8s_networkpolicy"
NAME_REGEX = r"^[a-z0-9-\.]{1,253}$"
NAME_REGEX_COMPILED = re.compile(NAME_REGEX)

def get_auto_deps(self, items):
return []

@property
def namespace(self):
return None


class KubernetesPersistentVolumeClain(KubernetesItem):
BUNDLE_ATTRIBUTE_NAME = "k8s_pvc"
KIND = "PersistentVolumeClaim"
Expand Down
1 change: 1 addition & 0 deletions docs/content/items/k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Note that the names of all items in a namespace must be prefixed with the name o
<tr><td>Deployment</td><td>k8s_deployments</td><td>extensions/v1beta1</td></tr>
<tr><td>Ingress</td><td>k8s_ingresses</td><td>extensions/v1beta1</td></tr>
<tr><td>Namespace</td><td>k8s_namespaces</td><td>v1</td></tr>
<tr><td>Network Policy</td><td>k8s_networkpolicies</td><td>networking.k8s.io/v1</td></tr>
<tr><td>Persistent Volume Claim</td><td>k8s_pvc</td><td>v1</td></tr>
<tr><td>Role</td><td>k8s_roles</td><td>rbac.authorization.k8s.io/v1</td></tr>
<tr><td>Role Binding</td><td>k8s_rolebindings</td><td>rbac.authorization.k8s.io/v1</td></tr>
Expand Down

0 comments on commit fe53903

Please sign in to comment.