Skip to content

Commit

Permalink
Add support for PodDisruptionBudget
Browse files Browse the repository at this point in the history
  • Loading branch information
flamur-gogolli committed Feb 6, 2018
1 parent 1724ef4 commit 71f073c
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions k8s/models/pod_disruption_budget.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import

import six

from .common import ObjectMeta
from ..base import Model
from ..fields import Field, ListField


class PodDisruptionBudgetMatchExpressions(Model):
key = Field(six.text_type)
operator = Field(six.text_type)
values = ListField(six.text_type)


class PodDisruptionBudgetSelector(Model):
matchExpressions = Field(PodDisruptionBudgetMatchExpressions)
matchLabels = Field(dict)


class PodDisruptionBudgetSpec(Model):
minAvailable = Field(six.text_type)
maxUnavailable = Field(six.text_type)
selector = Field(PodDisruptionBudgetSelector)


class PodDisruptionBudget(Model):
class Meta:
url_template = "/apis/autoscaling/v1/namespaces/{namespace}/poddisruptionbudget/{name}"

metadata = Field(ObjectMeta)
spec = Field(PodDisruptionBudgetSpec)

0 comments on commit 71f073c

Please sign in to comment.