Skip to content

Commit

Permalink
Merge pull request #398 from timbuchwaldt/master
Browse files Browse the repository at this point in the history
Add RBAC K8S items
  • Loading branch information
trehn committed Apr 16, 2018
2 parents c9c3257 + a4258a8 commit bbc12e5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
24 changes: 24 additions & 0 deletions bundlewrap/items/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,22 @@ def validate_name(cls, bundle, name):
))


class KubernetesClusterRole(KubernetesItem):
BUNDLE_ATTRIBUTE_NAME = "k8s_clusterroles"
KIND = "ClusterRole"
KUBECTL_RESOURCE_TYPE = "clusterroles"
KUBERNETES_APIVERSION = "rbac.authorization.k8s.io/v1"
ITEM_TYPE_NAME = "k8s_clusterrole"


class KubernetesClusterRoleBinding(KubernetesItem):
BUNDLE_ATTRIBUTE_NAME = "k8s_clusterrolebindings"
KIND = "ClusterRoleBinding"
KUBECTL_RESOURCE_TYPE = "clusterrolebindings"
KUBERNETES_APIVERSION = "rbac.authorization.k8s.io/v1"
ITEM_TYPE_NAME = "k8s_clusterrolebinding"


class KubernetesConfigMap(KubernetesItem):
BUNDLE_ATTRIBUTE_NAME = "k8s_configmaps"
KIND = "ConfigMap"
Expand Down Expand Up @@ -334,6 +350,14 @@ class KubernetesService(KubernetesItem):
ITEM_TYPE_NAME = "k8s_service"


class KubernetesServiceAccount(KubernetesItem):
BUNDLE_ATTRIBUTE_NAME = "k8s_serviceaccounts"
KIND = "ServiceAccount"
KUBECTL_RESOURCE_TYPE = "serviceaccounts"
KUBERNETES_APIVERSION = "v1"
ITEM_TYPE_NAME = "k8s_serviceaccount"


class KubernetesStatefulSet(KubernetesItem):
BUNDLE_ATTRIBUTE_NAME = "k8s_statefulsets"
KIND = "StatefulSet"
Expand Down
3 changes: 3 additions & 0 deletions docs/content/items/k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Note that all item names (except namespaces themselves) must be prefixed with th

<table>
<tr><th>Resource type</th><th>Bundle attribute</th><th>apiVersion</th></tr>
<tr><td>Cluster Role</td><td>k8s_clusterroles</td><td>rbac.authorization.k8s.io/v1</td></tr>
<tr><td>Cluster Role Binding</td><td>k8s_clusterrolebindingss</td><td>rbac.authorization.k8s.io/v1</td></tr>
<tr><td>Config Map</td><td>k8s_configmaps</td><td>v1</td></tr>
<tr><td>Cron Job</td><td>k8s_cronjobs</td><td>batch/v1beta1</td></tr>
<tr><td>Daemon Set</td><td>k8s_daemonsets</td><td>v1</td></tr>
Expand All @@ -37,6 +39,7 @@ Note that all item names (except namespaces themselves) must be prefixed with th
<tr><td>Namespace</td><td>k8s_namespaces</td><td>v1</td></tr>
<tr><td>Persistent Volume Claim</td><td>k8s_pvc</td><td>v1</td></tr>
<tr><td>Service</td><td>k8s_services</td><td>v1</td></tr>
<tr><td>Service Account</td><td>k8s_serviceaccounts</td><td>v1</td></tr>
<tr><td>Secret</td><td>k8s_secrets</td><td>v1</td></tr>
<tr><td>StatefulSet</td><td>k8s_statefulsets</td><td>apps/v1</td></tr>
</table>
Expand Down

0 comments on commit bbc12e5

Please sign in to comment.