Kubernetes有状态集群服务部署与管理时速云:张寿红Agenda•Background•WhatisKubernetes?•RunstatefulservicesonKubernetes•KubernetesStatefulServiceFeatures•InitContainer•PetSet•KubernetesStorage•Volume•PersistentVolume•DynamicStorageProvision•RunMySQLClusteronKubernetes•GaleraMySQLIntroduction•DeployMySQLClusterwithPetSet•ClusterOperationonKubernetesWhatisKubernetesWhatisKubernetesWhatisKubernetesWhatisKubernetesPetCattleRunStatefulServiceonKubernetes•Statelessservicesarepopularincontainerizedworldbecausetheyaredisposableandeasytobere-createdwithcontainerimages.•Beyondstatelessserviceslikewebserver,usersareincreasinglydeployingstatefulserviceswithcontainerstobenefitfrom“buildonce,runanywhere”andtoimprovebaremetalefficiency/utilization.•These“pets”bringnewrequirementsincludinglongerlifecycle,configurationdependenciesandstatefulfailover.Containerorchestrationmustaddresstheseneedstosuccessfullydeployandscaleapps.RunStatefulServiceonKubernetesStateless•Pod•RC/ReplicaSet•ServiceStateful•Volume•PersistentVolumeClustered•PetSet•InitContainer•HeadlessService•DynamicStorageProvisionAgenda•Background•WhatisKubernetes?•RunstatefulservicesonKubernetes•KubernetesStatefulServiceFeatures•InitContainer•PetSet•KubernetesStorage•Volume•PersistentVolume•DynamicStorageProvision•RunMySQLClusteronKubernetes•GaleraMySQLIntroduction•DeployMySQLClusterwithPetSet•ClusterOperationonKubernetesKubernetesStorage•NodeBasedVolume•emptyDir•hostPath•UseCases:•Storetempdata•DatasharingamongcontainersKubernetesStorage•hostPath•emptyDirKubernetesStorage•CrossNodeVolumeKubernetesStorageKubernetesClusterSharedVolumeVariousvolumepluginsUnsharedVolumeNodeNodeNodeCCCCCCCCCCCC•emptyDir•hostPath•gcePersistentDisk•awsElasticBlockStore•iscsi•rbd•azureFileVolume•nfs•hostPath•glusterfs•flocker•cephfs•secret•vsphereVirtualDiskKubernetesStorage•AddyourvolumepluginKubernetesStorage•PersistentVolume&PersistentVolumeClaim•PV/PVCabstractsdetailsofhows...