Click to edit Master title style,Click to edit Master text styles,Second level,Third level,Fourth level,Fifth level,*,*,Kubernetes有状态集群服务,部署与管理,Kubernetes有状态集群服务部署与管理,1,Agenda,Background,What,is,Kubernetes?,Run,stateful,services,on,Kubernetes,Kubernetes,Storage,Volume,Persistent,Volume,Dynamic,Storage,Provision,Kubernetes,Stateful,Service,Features,Init,Container,Pet,Set,Run,MySQL,Cluster,on,Kubernetes,Galera,MySQL,Introduction,Deploy,MySQL,Cluster,with,PetSet,Cluster,Operation,on,Kubernetes,Agenda Background Kuberne,2,What,is,Kubernetes,What is Kubernetes,3,What,is,Kubernetes,What is Kubernetes,4,What,is,Kubernetes,What is Kubernetes,5,What,is,Kubernetes,Pet,Cattle,What is KubernetesPetCattle,6,Run,Stateful,Service,on,Kubernetes,Stateless,services,are,popular,in,containerized,world,because,they,are,disposable,and,easy,to,be,re-created,with,container,images.,Beyond,stateless,services,like,web,server,users,are,increasingly,deploying,stateful,services,with,containers,to,benefit,from,“build,once,run,anywhere”,and,to,improve,bare,metal,efficiency/utilization.,These,“pets”,bring,new,requirements,including,longer,life,cycle,configuration,dependencies,and,stateful,failover.,Container,orchestration,must,address,these,needs,to,successfully,deploy,and,scale,apps.,Run Stateful Service on Kubern,7,Run,Stateful,Service,on,Kubernetes,Stateless,Pod,RC,Replica,Set,Service,Stateful,Volume,Persistent,Volume,Clustered,Pet,Set,Init,Container,Headless,Service,Dynamic,Storage,Provision,Run Stateful Service on Kubern,8,Agenda,Background,What,is,Kubernetes?,Run,stateful,services,on,Kubernetes,Kubernetes,Storage,Volume,Persistent,Volume,Dynamic,Storage,Provision,Kubernetes,Stateful,Service,Features,Init,Container,Pet,Set,Run,MySQL,Cluster,on,Kubernetes,Galera,MySQL,Introduction,Deploy,MySQL,Cluster,with,PetSet,Cluster,Operation,on,Kubernetes,Agenda Background Kuberne,9,Kubernetes,Storage,Node,Based,Volume,emptyDir,hostPath,Use,Cases,:,Store,temp,data,Data,sharing,among,containers,Kubernetes Storage Node Based,10,Kubernetes,Storage,hostPath,emptyDir,Kubernetes Storage hostPath,11,Kubernetes,Storage,Cross,Node,Volume,Kubernetes Storage Cross Nod,12,Kubernetes,Storage,Kubernetes,Cluster,Shared,Volume,Various,volume,plugins,Unshared,Volume,Node,C,C,C,C,Node,C,C,C,C,Node,C,C,C,C,emptyDir,hostPath,gcePersistentDisk,awsElasticBlockStore,iscsi,rbd,azureFileVolume,nfs,hostPath,glusterfs,flocker,cephfs,secret,vsphereVirtualDisk,Kubernetes StorageShared Volum,13,Kubernetes,Storage,Add,your,volume,plugin,Kubernetes Storage Add your v,14,Kubernetes,Storage,Persistent,Volume,&,Persistent,Volume,Claim,PV/PVC,abstracts,details,of,how,storage,is,provided,from,how,it,is,consumed.,PV/PVC,are,API,resources.,PVs,are,volume,plugins,like,Volumes,but,have,a,lifecycle,independent,of,any,individual,pod,that,uses,the,PV.,Kubernetes Storage Persistent,15,Kubernetes,Storage,PV,Access,Modes,Kubernetes Storage PV Access,16,Kubernetes,Storage,PV,Lifecycle,Provisioning,Binding,Using,Releasin,g,Reclaiming,Static,Dynamic,Available,Bound,Released,Retain,Delete,Recycle,Failed,Kubernetes StorageProvisionin,17,Kubernetes,Storage,PV,Provision,&,Binding,Process,Kubernetes Storage PV Provisi,18,kind:,StorageClass,apiVersion:,storage.k8s.io/v1beta1,metadata:,name:,slow,provisioner:,kubernetes.io/gce-,pd,parameters:,type:,pd-standard,Kubernetes,Storage,Dynamic,Storage,Provision,kind:,StorageClass,apiVersion:,storage.k8s.io/v1beta1,metadata:,name:,fast,provisioner:,kubernetes.io/gce-pd,parameters:,type:,pd-ssd,kind:StorageClassKubernetes,19,kind:,PersistentVolumeClaim,apiVersion:,v1,metadata:,name:,claim1,annotations:,volume.beta.kubernetes.io/storage-,class:,fast,Kubernetes,Storage,Dynamic,Storage,Provision,spec:,accessModes:,ReadWriteOnce,resources:,requests:,storage:,30Gi,This,claim,will,result,in,an,SSD-like,Persistent,Disk,being,automatically,provisioned.,When,the,claim,is,deleted,the,volume,will,be,destroyed.,kind:PersistentVolumeClaim,20,Agenda,Background,What,is,Kubernetes?,Run,stateful,services,on,Kubernetes,Kubernetes,Storage,Volume,Persistent,Volume,Dynamic,Storage,Provision,Kubernetes,Stateful,Service,Features,Init,Container,Pet,Set,Run,MySQL,Cluster,on,Kubernetes,Galera,MySQL,Introduction,Deploy,MySQL,Cluster,with,PetSet,Cluster,Operation,on,Kubernetes,Agenda Background Kuberne,21,Init,Container,What,is,Init,Container,Sequentially,executed,containers,in,a,pod,Initialize,shared,volumes,Always,run,to,completion,Used,on,a,pod,replica,set,deployment,daemon,set,pet,set,or,job.,Init,Container,1,Shared,Volumes,Init,Container,2,Primary,Container,Pod,Init ContainerSequentially ex,22,Init,Container,Why,Init,Container,Waiting,for,other,components,to,be,available,Performing,configuration,Registering,the,pod,into,a,central,database,Downloading,application,dependencies,Init ContainerWaiting for ot,23,Init,Container,Init Container,24,Pet,Set,Pet,vs,Pod,Pet,Stateful,Identit,y,Complex,Pod,Stateless,No,Identity,Simple,Pet Set Pet vs PodPod,25,Pet,Set,Stable,Storage,Network,Identity