KUBERNETES FOR JAVA DEVELOPERS
ROBERT BARR
ABOUT ME
Java developer and engineering manager since Java 1.1.7
Engineering Lead for DevOps and Development Practices Group
Head of Development and Data Grid for Infrastructure Engineering Group
Co-organiser for the Docklands London Java Community
ABOUT ME
Java developer and engineering manager since Java 1.1.7
Engineering Lead for DevOps and Development Practices Group
Head of Development and Data Grid for Infrastructure Engineering Group
Co-organiser for the Docklands London Java Community
AGENDA Quarkus, Micronaut and Spring Boot
Docker recap
Why Kubernetes?
Kubernetes architectureand concepts
Running Kuberneteslocally
Related Kubernetesconcepts
Deployment pipelines
SAMPLE
APPLICATION
@RestController
public class HelloWorldController {
@RequestMapping("/hello")
public String sayHello() {
return "hi mum";
}
}
https://github.com/runesmith2013/k8s4j.git
QUARKUS VS MICRONAUT VS SPRING BOOT
Quarkus is a “supersonic subatomic Java”. It is a Kubernetes-native Java stack designed for OpenJDK HotSpot and GraalVM
and includes the best Java libraries and standards. One of the pros of Quarkus is its speedy start-up time.
Micronaut is a cloud-native JVM-based polyglot full-stack framework for building microservices and serverless applications. It
features low memory consumption, no matter the size of your codebase.
Spring Boot is an open source Java framework that makes it easy to create stand-alone production-grade Spring applications
and microservices with embedded Tomcat, Jetty, or Undertow. Spring Boot apps require little configuration so they can “just
run”.
Project Leyden: New OpenJDK project to address Java start up time
Static application binaries with faster startup and lower memory. Once approved and completed, this would enable developers
to compile Java code (just-in-time) to native applications (ahead-of-time), offering capabilities like GraalVM's native mode.
QUARKUS VS MICRONAUT VS SPRING BOOT
https://jaxenter.com/micronaut-speed-test-170870.html
Source: https://jaxenter.com/micronaut-speed-test-170870.html
Packages applications with their dependencies into a portable, lightweightcontainer
This container can run locally, on premise or on cloud hosted infrastructure such as AWS Elastic Container Service
Docker solves the issue of environmental differences between Prod, UAT and DEV
DOCKER TERMINOLOGY
 Docker Daemon – runs on your host and listens for Docker API requests. Manages
containers and images
 Docker Image – base for running an application
 Docker container - running instance of a Docker image
 Dockerfile – script defining how to construct a Docker image
 Docker hub - online repo for storing Docker images
SAMPLE
DOCKERFILE
FROM maven:3.5-jdk-8 as BUILD
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN mvn package
FROM openjdk:8-jre
EXPOSE 8080 5005
COPY --from=BUILD /usr/src/app/target /opt/target
WORKDIR /opt/target
ENV _JAVA_OPTIONS '-
agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005'
CMD ["java", "-jar", "helloworld.war"]
COMMON DOCKER COMMANDS
docker image build –t tag/tag:version .
Communicates with the docker daemon to construct an image based on the dockerfile.
docker image ls
Shows the images stored in the local repo
docker run –p 8080:8080 –d imagename
instantiate and run a container from an image, exposing ports and running in detached mode
docker push myrepo/myimage:2.0
Push an image to a registry
https://www.docker.com/sites/default/files/d8/2019-09/docker-cheat-sheet.pdf
DOCKER AND MAVEN: SPOTIFY PLUGIN
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>${dockerfile-maven-version}</version> <executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
</executions>
<configuration>
<repository>spotify/foobar</repository>
<tag>${project.version}</tag>
<buildArgs>
<JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
* requires docker
* requires a dockerfile
* mvn build creates an image
* mvn deploy pushes to repo
Project is MATURE and not adding new features
DOCKER AND MAVEN: JIB PLUGIN
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>2.5.0</version>
<configuration>
<to>
<image>${image.path}</image>
</to>
</configuration>
</plugin>
* does not require docker
* does not require a Dockerfile
* opinionated default options
* separates app into layers – classes, resources, dependencies
* only builds changed layers
WHY KUBERNETES?
Kubernetes is open source software for deploying, scaling and managing
containerized applications.
As an orchestrator,it handles the work of scheduling containers on a
cluster and manages the workloads to ensure they run as intended.
WHY KUBERNETES?
Portability
Kubernetes offers portability, and faster, simpler deployment times.
Scalability
With Kubernetes ability to run containers on one or more public cloud environments,
in virtual machines, or on bare metal means that it can be deployed almost
anywhere and scale to any extent.
WHY KUBERNETES?
High Availability
Kubernetes addresses high availability at both the application and the infrastructure
level.
OpenSource
Since Kubernetes is open source, you can take advantage of the vast ecosystem of
other open source tools designed specifically to work with Kubernetes without the
lock-in of a closed/proprietary system.
WHY KUBERNETES?
Proven, and Battle Tested
A huge ecosystem of developers and tools with 5,608 GitHub repositories and counting
means that you won’t be forging ahead into new territory without help.
Kubernetes 101 Architecture
Kubernetes can manage rolling updates, adapts to additional workloads by auto
scaling nodes to increase capacity and can self-heal in the case of a pod meltdown.
KUBERNETES CONTROL PLANE
ETCD
Etcd Storage
Is an open-source key-value data store
Stores configuration data of the cluster’s
state.
KUBERNETES CONTROL PLANE
ETCD
API
Server
Kube-API-Server – The API server
manages requests from the worker
nodes, receives REST requests
for modifications, and serves as a front-
end to control cluster.
KUBERNETES CONTROL PLANE
ETCD
API
Server
Scheduler
Kube-scheduler – Schedules the pods
on nodes based on resource
utilization and decides where services
are deployed:
Quality of Service requirements,
hardware, software, policy constraints,
affinity and anti-affinity requirements
KUBERNETES CONTROL PLANE
ETCD
API
Server
Scheduler
Controller
manager
Kube-controller-manager – A set
of distinct controller processes to
regulate the shared state of the cluster
and perform routine tasks.
When there is a change to a service, the
controller recognizes the change and
initiates an update to bring the cluster
up to the desired state.
Includes the replication controller,
endpoints controller and namespace
controller
KUBERNETES CONTROL PLANE
ETCD
API
Server
Scheduler
Controller
manager
Cloud
controller
Cloud controller manager
Embeds cloud specific control logic
KUBERNETES CONTROL PLANE
ETCD
API
Server
Scheduler
Controller
manager
Cloud
controller
Add
Ons
Add Ons
Extends the functionality of Kubernetes.
DNS is a recommended add-on, which
provides name resolution for objects
deployed in Kubernetes
KUBERNETES WORKER
Kubelet
Kubelet
Primary node agent that runs on each
node
Communicates with master and ensures
containers are running and healthy
KUBERNETES WORKER
Kubelet
Kube-proxy
Network proxy running on each node
Provides K8s networking services
Kube-proxy
KUBERNETES FLOW
kubectl Control Plane
Data Plane
kubectl apply –f resource.yaml
KUBERNETES
CONCEPTS
Containers
Typically Docker containers, but Kubernetes also supports a
variety of other container types
Pods
A pod is the basic building block for Kubernetes.
Pods are generally collections of related containers, but a pod
may also only have one container.
A pod shares network/storage and a specification for how to run
the containers.
KUBERNETES
CONCEPTS
Deployments
Describes a desired state of containers and pods
Supports:
- increasing the number of replicas in a set
- rolling out new states
- rolling back to older versions
- scaling up to facilitate more load
- pausing deployments
- clean up obsolete sets
KUBERNETES
CONCEPTS
Service
A Kubernetes Service is an abstraction layer which defines a logical set of
Pods and enables external traffic exposure, load balancing and service
discovery for those Pods.
The set of Pods targeted by a Service is usually determined by a selector.
KUBERNETES
CONCEPTS
Service Types
ClusterIP (default)
Exposes the Service on an internal IP in the cluster. This type makes the Service only reachable from
within the cluster.
NodePort
Exposes the Service on the same port of each selected Node in the cluster using NAT. Makes a Service
accessible from outside the cluster using <NodeIP>:<NodePort>
LoadBalancer
Creates an external load balancer in the current cloud (if supported) and assigns a fixed, external IP to
the Service
KUBERNETES RESOURCE MANIFEST: DEPLOYMENT
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello
spec:
replicas: 1
selector:
matchLabels:
app: hello
template:
metadata:
labels:
app: hello
spec:
containers:
- name: hello
image: runesmith/hello
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
name: "http"
- containerPort: 5005
name: "debug"
KUBERNETES RESOURCE MANIFEST: SERVICE
apiVersion: v1
kind: Service
metadata:
name: hello
spec:
selector:
app: hello
ports:
- name: http
protocol: TCP
port: 8080
targetPort: 8080
type: LoadBalancer
KUBERNETES JAVA CLIENT
<dependency>
<groupId>io.kubernetes</groupId>
<artifactId>client-java</artifactId>
<version>10.0.0</version>
</dependency>
ApiClientclient = Config.defaultClient();
Configuration.setDefaultApiClient(client);
CoreV1Api api = new CoreV1Api();
V1Pod pod = new V1PodBuilder()
.withNewMetadata()
.withName("apod")
.endMetadata()
.withNewSpec()
.addNewContainer()
.withName("www")
.withImage("nginx")
.endContainer()
.endSpec()
.build();
api.createNamespacedPod("default", pod, null, null, null);
https://github.com/kubernetes-client/java/
KUBECTL COMMON COMMANDS
kubectl config get-contexts # display list of contexts
kubectl apply -f ./my-manifest.yaml # create resource(s)
kubectl get services, pods, deployments # report on status of services, pods, deployments
kubectl logs <pod> # display logs from given pod
kubectl rollout history deployment/frontend # Check the history of deployments including the revision
kubectl rollout undo deployment/frontend # Rollback to the previous deployment
kubectl rollout restart deployment/frontend # Rolling restart of the "frontend" deployment
kubectl autoscale deployment foo --min=2 --max=10
https://kubernetes.io/docs/reference/kubectl/cheatsheet/
WEB UI
Dashboard is a web-based Kubernetes
user interface.
Deploy containerized applications to a
Kubernetes cluster, troubleshoot your
containerized application, and
manage the cluster resources.
Get an overview of applications
running on your cluster
Scale a Deployment, initiate a rolling
update, restart a pod or deploy new
applications using a deploy wizard.
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml
LOCAL K8S: MINIKUBE
1. InstallMinikube
brew install minikube
2. Start your cluster
minikube start
3. Interact with cluster
minikube kubectl -- get po –A // download kubectl
minikube dashboard // bundled kubernetes dashboard
kubectl get po –A // use kubectl to access cluster
LOCAL K8S: DOCKER DESKTOP
1. Click Docker Desktop icon
2. Click preferences
3. Enable Kubernetes
KATACODA: INTERACTIVE BROWSER-BASED
SCENARIOS
Launch a single node cluster
Launch a multi-node cluster using Kubeadm
Deploy Containers Using Kubectl
Deploy Containers Using YAML
https://www.katacoda.com/courses/kubernetes/playground
HELM: THE PACKAGE MANAGER FOR KUBERNETES
Packagemanager for Kubernetes
Allows you to deploy your app as a single package rather
than dealing with multiple manifest files
Allows us to manage multiple releases with different
configurations
Collection of YAML template files, so are text-based and
versionable
Analagous to apt, yum or homebrew for kubernetes
DEPLOYMENT PIPELINES: SKAFFOLD
SKAFFOLD
Skaffold is a command line tool that facilitates continuous developmentfor
Kubernetes-native applications. This enables you to focus on iterating on your
application locally while Skaffold continuously deploys to your local or remote
Kubernetes cluster.
ISTIO SERVICE MESH
Provides the fundamentals needed to successfully run a distributed
microservices architecture
Security
Authentication, authorisation and encryption of communication between
microservices
Observability
Provides tracing, monitoring and logging and performance analytics
Traffic management
Control traffic and API calls between services. Enables A/B testing, traffic
shaping and canary testing
RESOURCES
https://github.com/runesmith2013/k8s4j.git
Spring boot sample app using Docker, Kubernetes, Helm and Skaffold
https://www.katacoda.com/courses/kubernetes/playground
Browser-based kubernetes playground
https://github.com/kubernetes-client/java/
Kubernetes Java client library
https://www.docker.com/sites/default/files/d8/2019-09/docker-cheat-sheet.pdf
Docker commands cheat sheet
https://cloud.google.com/istio
Google cloud Istio project
https://www.redhat.com/en/topics/microservices/what-is-istio
Redhat resources on Istio
https://helm.sh/
Helm documentation
https://kubernetes.io/docs/reference/kubectl/cheatsheet/
Kubeclt commands cheat sheet
https://skaffold.dev/docs/
Skaffold
https://www.infoq.com/news/2020/05/java-leyden/
Project Leyden
RESOURCES
https://github.com/kelseyhightower/kubernetes-the-hard-way
in depth guide to setting up and running a k8s cluster
https://www.linkedin.com/learning/kubernetes-for-java-developers
Arun Gupta's course on Kubernetes for Java Developers
https://www.magalix.com/blog/create-a-ci/cd-pipeline-with-kubernetes-and-jenkins
Go-based tutorial on setting up a pipeline with kubernetes and jenkins

Kubernetes for Java developers

  • 1.
    KUBERNETES FOR JAVADEVELOPERS ROBERT BARR
  • 2.
    ABOUT ME Java developerand engineering manager since Java 1.1.7 Engineering Lead for DevOps and Development Practices Group Head of Development and Data Grid for Infrastructure Engineering Group Co-organiser for the Docklands London Java Community
  • 3.
    ABOUT ME Java developerand engineering manager since Java 1.1.7 Engineering Lead for DevOps and Development Practices Group Head of Development and Data Grid for Infrastructure Engineering Group Co-organiser for the Docklands London Java Community
  • 4.
    AGENDA Quarkus, Micronautand Spring Boot Docker recap Why Kubernetes? Kubernetes architectureand concepts Running Kuberneteslocally Related Kubernetesconcepts Deployment pipelines
  • 5.
    SAMPLE APPLICATION @RestController public class HelloWorldController{ @RequestMapping("/hello") public String sayHello() { return "hi mum"; } } https://github.com/runesmith2013/k8s4j.git
  • 6.
    QUARKUS VS MICRONAUTVS SPRING BOOT Quarkus is a “supersonic subatomic Java”. It is a Kubernetes-native Java stack designed for OpenJDK HotSpot and GraalVM and includes the best Java libraries and standards. One of the pros of Quarkus is its speedy start-up time. Micronaut is a cloud-native JVM-based polyglot full-stack framework for building microservices and serverless applications. It features low memory consumption, no matter the size of your codebase. Spring Boot is an open source Java framework that makes it easy to create stand-alone production-grade Spring applications and microservices with embedded Tomcat, Jetty, or Undertow. Spring Boot apps require little configuration so they can “just run”. Project Leyden: New OpenJDK project to address Java start up time Static application binaries with faster startup and lower memory. Once approved and completed, this would enable developers to compile Java code (just-in-time) to native applications (ahead-of-time), offering capabilities like GraalVM's native mode.
  • 7.
    QUARKUS VS MICRONAUTVS SPRING BOOT https://jaxenter.com/micronaut-speed-test-170870.html Source: https://jaxenter.com/micronaut-speed-test-170870.html
  • 8.
    Packages applications withtheir dependencies into a portable, lightweightcontainer This container can run locally, on premise or on cloud hosted infrastructure such as AWS Elastic Container Service Docker solves the issue of environmental differences between Prod, UAT and DEV
  • 9.
    DOCKER TERMINOLOGY  DockerDaemon – runs on your host and listens for Docker API requests. Manages containers and images  Docker Image – base for running an application  Docker container - running instance of a Docker image  Dockerfile – script defining how to construct a Docker image  Docker hub - online repo for storing Docker images
  • 10.
    SAMPLE DOCKERFILE FROM maven:3.5-jdk-8 asBUILD COPY . /usr/src/app WORKDIR /usr/src/app RUN mvn package FROM openjdk:8-jre EXPOSE 8080 5005 COPY --from=BUILD /usr/src/app/target /opt/target WORKDIR /opt/target ENV _JAVA_OPTIONS '- agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005' CMD ["java", "-jar", "helloworld.war"]
  • 11.
    COMMON DOCKER COMMANDS dockerimage build –t tag/tag:version . Communicates with the docker daemon to construct an image based on the dockerfile. docker image ls Shows the images stored in the local repo docker run –p 8080:8080 –d imagename instantiate and run a container from an image, exposing ports and running in detached mode docker push myrepo/myimage:2.0 Push an image to a registry https://www.docker.com/sites/default/files/d8/2019-09/docker-cheat-sheet.pdf
  • 12.
    DOCKER AND MAVEN:SPOTIFY PLUGIN <plugin> <groupId>com.spotify</groupId> <artifactId>dockerfile-maven-plugin</artifactId> <version>${dockerfile-maven-version}</version> <executions> <execution> <id>default</id> <goals> <goal>build</goal> <goal>push</goal> </goals> </execution> </executions> <configuration> <repository>spotify/foobar</repository> <tag>${project.version}</tag> <buildArgs> <JAR_FILE>${project.build.finalName}.jar</JAR_FILE> </buildArgs> </configuration> * requires docker * requires a dockerfile * mvn build creates an image * mvn deploy pushes to repo Project is MATURE and not adding new features
  • 13.
    DOCKER AND MAVEN:JIB PLUGIN <plugin> <groupId>com.google.cloud.tools</groupId> <artifactId>jib-maven-plugin</artifactId> <version>2.5.0</version> <configuration> <to> <image>${image.path}</image> </to> </configuration> </plugin> * does not require docker * does not require a Dockerfile * opinionated default options * separates app into layers – classes, resources, dependencies * only builds changed layers
  • 14.
    WHY KUBERNETES? Kubernetes isopen source software for deploying, scaling and managing containerized applications. As an orchestrator,it handles the work of scheduling containers on a cluster and manages the workloads to ensure they run as intended.
  • 15.
    WHY KUBERNETES? Portability Kubernetes offersportability, and faster, simpler deployment times. Scalability With Kubernetes ability to run containers on one or more public cloud environments, in virtual machines, or on bare metal means that it can be deployed almost anywhere and scale to any extent.
  • 16.
    WHY KUBERNETES? High Availability Kubernetesaddresses high availability at both the application and the infrastructure level. OpenSource Since Kubernetes is open source, you can take advantage of the vast ecosystem of other open source tools designed specifically to work with Kubernetes without the lock-in of a closed/proprietary system.
  • 17.
    WHY KUBERNETES? Proven, andBattle Tested A huge ecosystem of developers and tools with 5,608 GitHub repositories and counting means that you won’t be forging ahead into new territory without help. Kubernetes 101 Architecture Kubernetes can manage rolling updates, adapts to additional workloads by auto scaling nodes to increase capacity and can self-heal in the case of a pod meltdown.
  • 18.
    KUBERNETES CONTROL PLANE ETCD EtcdStorage Is an open-source key-value data store Stores configuration data of the cluster’s state.
  • 19.
    KUBERNETES CONTROL PLANE ETCD API Server Kube-API-Server– The API server manages requests from the worker nodes, receives REST requests for modifications, and serves as a front- end to control cluster.
  • 20.
    KUBERNETES CONTROL PLANE ETCD API Server Scheduler Kube-scheduler– Schedules the pods on nodes based on resource utilization and decides where services are deployed: Quality of Service requirements, hardware, software, policy constraints, affinity and anti-affinity requirements
  • 21.
    KUBERNETES CONTROL PLANE ETCD API Server Scheduler Controller manager Kube-controller-manager– A set of distinct controller processes to regulate the shared state of the cluster and perform routine tasks. When there is a change to a service, the controller recognizes the change and initiates an update to bring the cluster up to the desired state. Includes the replication controller, endpoints controller and namespace controller
  • 22.
  • 23.
    KUBERNETES CONTROL PLANE ETCD API Server Scheduler Controller manager Cloud controller Add Ons AddOns Extends the functionality of Kubernetes. DNS is a recommended add-on, which provides name resolution for objects deployed in Kubernetes
  • 24.
    KUBERNETES WORKER Kubelet Kubelet Primary nodeagent that runs on each node Communicates with master and ensures containers are running and healthy
  • 25.
    KUBERNETES WORKER Kubelet Kube-proxy Network proxyrunning on each node Provides K8s networking services Kube-proxy
  • 26.
    KUBERNETES FLOW kubectl ControlPlane Data Plane kubectl apply –f resource.yaml
  • 27.
    KUBERNETES CONCEPTS Containers Typically Docker containers,but Kubernetes also supports a variety of other container types Pods A pod is the basic building block for Kubernetes. Pods are generally collections of related containers, but a pod may also only have one container. A pod shares network/storage and a specification for how to run the containers.
  • 28.
    KUBERNETES CONCEPTS Deployments Describes a desiredstate of containers and pods Supports: - increasing the number of replicas in a set - rolling out new states - rolling back to older versions - scaling up to facilitate more load - pausing deployments - clean up obsolete sets
  • 29.
    KUBERNETES CONCEPTS Service A Kubernetes Serviceis an abstraction layer which defines a logical set of Pods and enables external traffic exposure, load balancing and service discovery for those Pods. The set of Pods targeted by a Service is usually determined by a selector.
  • 30.
    KUBERNETES CONCEPTS Service Types ClusterIP (default) Exposesthe Service on an internal IP in the cluster. This type makes the Service only reachable from within the cluster. NodePort Exposes the Service on the same port of each selected Node in the cluster using NAT. Makes a Service accessible from outside the cluster using <NodeIP>:<NodePort> LoadBalancer Creates an external load balancer in the current cloud (if supported) and assigns a fixed, external IP to the Service
  • 31.
    KUBERNETES RESOURCE MANIFEST:DEPLOYMENT apiVersion: apps/v1 kind: Deployment metadata: name: hello spec: replicas: 1 selector: matchLabels: app: hello template: metadata: labels: app: hello spec: containers: - name: hello image: runesmith/hello imagePullPolicy: IfNotPresent ports: - containerPort: 8080 name: "http" - containerPort: 5005 name: "debug"
  • 32.
    KUBERNETES RESOURCE MANIFEST:SERVICE apiVersion: v1 kind: Service metadata: name: hello spec: selector: app: hello ports: - name: http protocol: TCP port: 8080 targetPort: 8080 type: LoadBalancer
  • 33.
    KUBERNETES JAVA CLIENT <dependency> <groupId>io.kubernetes</groupId> <artifactId>client-java</artifactId> <version>10.0.0</version> </dependency> ApiClientclient= Config.defaultClient(); Configuration.setDefaultApiClient(client); CoreV1Api api = new CoreV1Api(); V1Pod pod = new V1PodBuilder() .withNewMetadata() .withName("apod") .endMetadata() .withNewSpec() .addNewContainer() .withName("www") .withImage("nginx") .endContainer() .endSpec() .build(); api.createNamespacedPod("default", pod, null, null, null); https://github.com/kubernetes-client/java/
  • 34.
    KUBECTL COMMON COMMANDS kubectlconfig get-contexts # display list of contexts kubectl apply -f ./my-manifest.yaml # create resource(s) kubectl get services, pods, deployments # report on status of services, pods, deployments kubectl logs <pod> # display logs from given pod kubectl rollout history deployment/frontend # Check the history of deployments including the revision kubectl rollout undo deployment/frontend # Rollback to the previous deployment kubectl rollout restart deployment/frontend # Rolling restart of the "frontend" deployment kubectl autoscale deployment foo --min=2 --max=10 https://kubernetes.io/docs/reference/kubectl/cheatsheet/
  • 35.
    WEB UI Dashboard isa web-based Kubernetes user interface. Deploy containerized applications to a Kubernetes cluster, troubleshoot your containerized application, and manage the cluster resources. Get an overview of applications running on your cluster Scale a Deployment, initiate a rolling update, restart a pod or deploy new applications using a deploy wizard. kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml
  • 36.
    LOCAL K8S: MINIKUBE 1.InstallMinikube brew install minikube 2. Start your cluster minikube start 3. Interact with cluster minikube kubectl -- get po –A // download kubectl minikube dashboard // bundled kubernetes dashboard kubectl get po –A // use kubectl to access cluster
  • 37.
    LOCAL K8S: DOCKERDESKTOP 1. Click Docker Desktop icon 2. Click preferences 3. Enable Kubernetes
  • 38.
    KATACODA: INTERACTIVE BROWSER-BASED SCENARIOS Launcha single node cluster Launch a multi-node cluster using Kubeadm Deploy Containers Using Kubectl Deploy Containers Using YAML https://www.katacoda.com/courses/kubernetes/playground
  • 39.
    HELM: THE PACKAGEMANAGER FOR KUBERNETES Packagemanager for Kubernetes Allows you to deploy your app as a single package rather than dealing with multiple manifest files Allows us to manage multiple releases with different configurations Collection of YAML template files, so are text-based and versionable Analagous to apt, yum or homebrew for kubernetes
  • 40.
    DEPLOYMENT PIPELINES: SKAFFOLD SKAFFOLD Skaffoldis a command line tool that facilitates continuous developmentfor Kubernetes-native applications. This enables you to focus on iterating on your application locally while Skaffold continuously deploys to your local or remote Kubernetes cluster.
  • 42.
    ISTIO SERVICE MESH Providesthe fundamentals needed to successfully run a distributed microservices architecture Security Authentication, authorisation and encryption of communication between microservices Observability Provides tracing, monitoring and logging and performance analytics Traffic management Control traffic and API calls between services. Enables A/B testing, traffic shaping and canary testing
  • 43.
    RESOURCES https://github.com/runesmith2013/k8s4j.git Spring boot sampleapp using Docker, Kubernetes, Helm and Skaffold https://www.katacoda.com/courses/kubernetes/playground Browser-based kubernetes playground https://github.com/kubernetes-client/java/ Kubernetes Java client library https://www.docker.com/sites/default/files/d8/2019-09/docker-cheat-sheet.pdf Docker commands cheat sheet https://cloud.google.com/istio Google cloud Istio project https://www.redhat.com/en/topics/microservices/what-is-istio Redhat resources on Istio https://helm.sh/ Helm documentation https://kubernetes.io/docs/reference/kubectl/cheatsheet/ Kubeclt commands cheat sheet https://skaffold.dev/docs/ Skaffold https://www.infoq.com/news/2020/05/java-leyden/ Project Leyden
  • 44.
    RESOURCES https://github.com/kelseyhightower/kubernetes-the-hard-way in depth guideto setting up and running a k8s cluster https://www.linkedin.com/learning/kubernetes-for-java-developers Arun Gupta's course on Kubernetes for Java Developers https://www.magalix.com/blog/create-a-ci/cd-pipeline-with-kubernetes-and-jenkins Go-based tutorial on setting up a pipeline with kubernetes and jenkins