-
Notifications
You must be signed in to change notification settings - Fork 1
Deployment
Gregory Nickonov edited this page Mar 4, 2019
·
4 revisions
R.deployment :backend do
# Specify number of replicas
replicas 2
# Specify labels
match_labels feature: :main, component: :backend
container do
# Define main container
end
endDeployment is one of the Pod Template Owners, so all methods, like pod_template and container are available.
| Sunstone property | Kubernetes property | Type |
|---|---|---|
| metadata | metadata | Kubernetes Object Metadata |
| spec | spec | DeploymentSpec |
Shortcut to spec.replicas, used to specify desired number of Pod replicas:
R.deployment :backend do
replicas 2
endUsed to tell Deployment how to find its Pods. Labels are specified in the Pod template and the same labels (or match expressions) are specified in the Deployment selector (.spec.selector):
R.deployment :backend do
match_labels feature: :main, component: :backend
endThe code above will generate the following YAML:
apiVersion: apps/v1
kind: Deployment
metadata:
name: backend
spec:
selector:
matchLabels:
feature: main
component: backend
template:
metadata:
feature: main
component: backend
...| Sunstone property | Kubernetes property | Type |
|---|---|---|
| min_ready_seconds | minReadySeconds | Integer |
| paused | paused | Boolean |
| progress_deadline_seconds | progressDeadlineSeconds | Integer |
| replicas | replicas | Integer |
| revision_history_limit | revisionHistoryLimit | Integer |
| selector | selector | LabelSelector |
| strategy | strategy | DeploymentStrategy |
| template | template | PodTemplateSpec |