Weitere ähnliche Inhalte Ähnlich wie Introducing Koki Short (20) Kürzlich hochgeladen (20) Introducing Koki Short8. Mental Models
● ksonnet
● Tries to the ease the
understanding of kubernetes
primitives
● Developer centric view of
kubernetes resources
13. Deploy Definition - Master
kind: Pod
apiVersion: v1
metadata:
name: postgresql-master
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
key: zone
operator: eq
values:
- AZ1
containers:
- name: master-container
image: wlan0/postgresql-master:v0.1
volumeMounts:
- mountPath: /postgresql
name: masterPV
- name: master-sidecar
image: wlan0/postgresql-sidecar:v0.1
volumes:
- name: masterPV
awsElasticBlockStore:
volumeID: <awsVolumeID>
fsType: ext4
14. Deploy Definition - Short hand syntax
pod:
containers:
- name: master-container
image: wlan0/postgresql-master:v0.1
volumeMounts:
- mountPath: /postgresql
name: masterPV
- name: master-sidecar
image: wlan0/postgresql-sidecar:v0.1
name: posgresql-master
host: hg1
15. Deploy Definition - Master
kind: Pod
apiVersion: v1
metadata:
name: postgresql-master
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
key: zone
operator: eq
values:
- AZ1
containers:
- name: master-container
image: wlan0/postgresql-master:v0.1
volumeMounts:
- mountPath: /postgresql
name: masterPV
- name: master-sidecar
image: wlan0/postgresql-sidecar:v0.1
volumes:
- name: masterPV
awsElasticBlockStore:
volumeID: <awsVolumeID>
fsType: ext4
16. Deploy Definition - Short hand syntax
pod:
containers:
- name: master-container
image: wlan0/postgresql-master:v0.1
volumeMounts:
- mountPath: /postgresql
name: masterPV
- name: master-sidecar
image: wlan0/postgresql-sidecar:v0.1
name: posgresql-master
host: hg1
17. Deploy Definition - Master
kind: Pod
apiVersion: v1
metadata:
name: postgresql-master
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
key: zone
operator: eq
values:
- AZ1
containers:
- name: master-container
image: wlan0/postgresql-master:v0.1
volumeMounts:
- mountPath: /postgresql
name: masterPV
- name: master-sidecar
image: wlan0/postgresql-sidecar:v0.1
volumes:
- name: masterPV
awsElasticBlockStore:
volumeID: <awsVolumeID>
fsType: ext4
18. Deploy Definition - Imports
Import masterPV from master-pv.yaml
pod:
containers:
- name: master-container
image: wlan0/postgresql-master:v0.1
volume: masterPV:/postgresql
- name: master-sidecar
image: wlan0/postgresql-sidecar:v0.1
name: posgresql-master
host: hg1
volume:
name: master-pv
provision: true
awsEbs:
iops: 20000
capacity: 500G
master-pv.yaml
20. State Machine controls
import pod1.yaml
Import handlers.yaml
app:
name: redis
resources:
- pod1
- service: //service definition in
short-hand syntax
name: svc1
selectors:
pod1
expose: //services exposed by this app
- svc1
states:
- create: //state before deploy
handlers:
- provision-volumes //imported
from handlers.yaml
- create-certs
- deploy // no handlers needed
- upgrade:
handlers:
- perform-backup
21. Abstract Hosts & Grouping
PostgreSQL
Slave
PostgreSQL
Master
PostgreSQL
Slave
Synchronous replication
Asynchronous replication
Host 1 Host 2 Host 3 Host 4 Host 5
Availability Zone 1 Availability Zone 2
HG1 HG2
22. Auto pilot pattern
Func pre(input obj, *out obj) {
}
Func post(intput obj, *out obj) {
}
Lifecycle
Controller
Application PodApplication Pod
kubectl apply -f ...
23. Koki
● Yaml short hand syntax
● Builds on Kube-native models
● Declarative interface
● Cluster and Infrastructure agnostic
● State Management and more powerful features...