Skip to content

Commit

Permalink
Support for lifecycle hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
mortenlj committed Jan 4, 2018
1 parent ff629c8 commit 2286032
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions k8s/models/pod.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@ class Probe(Model):
periodSeconds = Field(int)


class Handler(Model):
httpGet = Field(HTTPGetAction)
tcpSocket = Field(TCPSocketAction)
_exec = Field(ExecAction)


class Lifecycle(Model):
postStart = Field(Handler)
preStop = Field(Handler)


class Container(Model):
name = Field(six.text_type)
image = Field(six.text_type)
Expand All @@ -115,6 +126,7 @@ class Container(Model):
envFrom = ListField(EnvFromSource)
resources = Field(ResourceRequirements)
volumeMounts = ListField(VolumeMount)
lifecycle = Field(Lifecycle)
livenessProbe = Field(Probe)
readinessProbe = Field(Probe)
imagePullPolicy = Field(six.text_type, "IfNotPresent")
Expand Down

0 comments on commit 2286032

Please sign in to comment.