-
Notifications
You must be signed in to change notification settings - Fork 1
StatefulSet
Gregory Nickonov edited this page Mar 4, 2019
·
3 revisions
R.stateful_set :database do
container do
image 'postgres:alpine'
expose_port 5432
environment do
add POSTGRES_USER: 'postgres', POSTGRES_PASSWORD: 'secretpassword'
end
mount_volume :data, '/var/lib/postgresql/data', sub_path: 'data'
end
volume_claim :data do
access_mode :ReadWriteOnce
storage_request '8Gi'
storage_class_name 'ssd'
end
end
StatefulSet 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 | StatefulSetSpec |
Declares a PersistentVolumeClaim with the specified name and uses supplied block to configure newly declared volume claim:
R.stateful_set :database do
volume_claim :data do
# Configure claim here
end
end
Sunstone property | Kubernetes property | Type |
---|---|---|
pod_management_policy | podManagementPolicy | String |
replicas | replicas | Integer |
revision_history_limit | revisionHistoryLimit | Integer |
selector | selector | LabelSelector |
service_name | serviceName | String |
template | template | PodTemplateSpec |
update_strategy | updateStrategy | StatefulSetUpdateStrategy |
volume_claim_templates | volumeClaimTemplates | Array of PersistentVolumeClaim |
Sunstone property | Kubernetes property | Type |
---|---|---|
type | type | String |
rolling_update | rollingUpdate | RollingUpdateStatefulSetUpdateStrategy |
Sunstone property | Kubernetes property | Type |
---|---|---|
partition | partition | Integer |