kubernetes for java developer · 2019-09-27 · coreos tectonic kubernetes operations (kops) raspi...

40
" m " for menu, "? " for other shortcuts KUBERNETES FOR JAVA DEVELOPER ObjektForum Karlsruhe, 01/2019 Roland Huß, Red Hat, @ro14nd

Upload: others

Post on 08-Apr-2020

13 views

Category:

Documents


0 download

TRANSCRIPT

"m " fo r menu , "? " fo r o the r sho r tcu ts

KUBERNETESFORJAVADEVELOPER

ObjektForumKarlsruhe, 01/2019

RolandHuß,RedHat, @ro14nd

KUBERNETESOpenSourceorchestrationsystemforcontainersSchedulingHorizontalscalingSelf-healingServicediscoveryAutomatedrolloutandrollbacks

ARCHITECTURE

KUBERNETESINTHECLOUDGoogleKubernetesEngine(GKE)AzureContainerService(AKS)OpenShiftOnlineAWSEC2,DigitalOcean,...Stackpoint.ioCoreOSTectonicKubernetesOperations(kops)

RASPICLUSTER4RaspberryPi3WifiRouter6PortUSBcharger32GBSD-CardsCosts:~300€InstallviaAnsiblekubeadm

FullStory:https://ro14nd.de/kubernetes-on-raspberry-pi3

ANSIBLEAnsiblePlaybooksforsettingupKubernetesbasedunkubeadmFlanneloverlaynetworkAdminUI,IngressController(Traefik)

Soon:RegistryOpenShift

https://github.com/Project31/ansible-kubernetes-openshift-pi3

MINIKUBESingle-nodeKubernetesclusterinsideaVMNoDockerdaemonrequiredIdealforlocaldevelopmentSupportsDNS,NodePorts,Volumes,...https://github.com/kubernetes/minikube

FABRIC8MicroservicesPlatformforKubernetes&OpenShiftUpstreamprojectsforopenshift.ioThemes:ContinousDeliveryManagementUIQuickstartsTooling

FABRIC8-MAVEN-PLUGINCreatesDockerimagesandresourcedescriptorsZero-configurationmodewithopinionateddefaultshttps://maven.fabric8.io

GOALS

fabric8:build Buildapplicationimages(Docker,S2Ibinary,S2Isource)

fabric8:resource CreateKubernetesandOpenShiftresourcedescriptors

fabric8:apply Applyresourcedescriptorstoarunningcluster

CONFIGURATIONZeroConfigOpinionatedDefaultsLimitedconfigurationoptions

XMLConfigurationRestrictedconfigurationsyntax

ResourceFragmentsMostpowerfulVerbose

ZEROCONFIGGeneratorsforImagegeneration <build> <plugins> <plugin> <groupid>io.fabric8</groupid> <artifactid>fabric8-maven-plugin</artifactid> <version>3.5.39</version> </plugin> <plugin> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-maven-plugin</artifactid> </plugin> </plugins> </build>

RESOURCEFRAGMENTSResourcefragmentsrc/main/fabric8/pong-rc.yml

spec: replicas: 1 template: spec: containers: - name: pong ports: - containerPort: 8080

GENERATORSExtractDockerimageconfigurationfrompom.xmlSupportedtechnologies:SpringBootWildflySwarmFatJarsEclipseVert.xWebappsKaraf

ENRICHERSAdddefaultKubernetesresourcesUpdateexistingresourcesE.g.DefaultDeploymentandServiceGitinformationaslabelsAddhealthchecksAddOpenShiftroutes....

PROFILESNamedcollectionofenrichersandgenerators-Dfabric8.profiletoselect

raw Noenrichment

explicit Onlydefaultobjects

minimal Smallenrichments

aggregate Combineresourcesfromdependencies

MISC

fabric8:install Installlocaldevelopmentenvironment

fabric8:cluster-start

Startminikubeorminishift

fabric8:watch Watchforchangesandredeployments

fabric8:debug Debugintopods

OPENSHIFTAddstheBUILDtoKubernetesInfrastructureServicesRegistryRouterOAuth2SSO

MultitenancyManagementUI...

OPENSHIFTEXTRAS

MINISHIFTSingle-nodeOpenShiftOriginclusterinsideaVMBasedonoc cluster upSupportsroutes,registry,s2ibuilds,....https://github.com/minishift/minishift

WRAPUPStartingwithKubernetescanbealmostaseasyaswithDockerKubernetesandOpenShiftarepowerfulorchestrationplatformswithenterprisegradefeatures.Usefabric8-maven-pluginforJavaapps

https://leanpub.com/k8spatterns

QUESTIONS?

Twitter @ro14nd

Slides https://github.com/ro14nd-talks/kubernetes-for-java-developers

POD

KubernetesAtomOneormorecontainerssharing:IPandportsVolumes

EphemeralIPaddress

LABELSMetadataattachabletoeveryresourceobjectUsedtocategorizestuffImportantforselectors"Freeform"

REPLICATIONCONTROLLERResponsibleformanagingPodsreplicas:NumberofPodcopiestokeepLabelselectorchoosePodsHoldsatemplateforcreatingnewPods

SERVICEProxyforasetofPodsPodsselectedbyLabelselectorPermanentIPaddress

VOLUMESDistributedstorageSupporttypes:LocalNFSGlusterCeph...

MISCFEATURESSecretsConfigMapsServiceAccountsHealth&LivenessChecksIngress