Openshift Container Platform Technical Overview
Total Page:16
File Type:pdf, Size:1020Kb
OPENSHIFT CONTAINER PLATFORM TECHNICAL OVERVIEW Presenter Presenter’s title Date Self-Service Standards-based Multi-language Web-scale Automation Open Source Collaboration Enterprise Grade Multi-tenant Secure 2 OPENSHIFT TECHNICAL OVERVIEW OPENSHIFT ARCHITECTURE c 3 OPENSHIFT TECHNICAL OVERVIEW LINUX CONTAINERS WHAT ARE CONTAINERS? It Depends Who You Ask INFRASTRUCTURE APPLICATIONS ● Application processes on a shared kernel ● Package apps with all dependencies ● Simpler, lighter, and denser than VMs ● Deploy to any environment in seconds ● Portable across different environments ● Easily accessed and shared 5 OPENSHIFT TECHNICAL OVERVIEW VIRTUAL MACHINES AND CONTAINERS VIRTUAL MACHINES CONTAINERS VM Container Container Container Container App App App App App App App App OS Dependencies OS deps OS deps OS deps OS deps Kernel Container Host (Kernel) Hypervisor Hardware Hardware virtual machines are isolated containers are isolated apps are not so are the apps 6 OPENSHIFT TECHNICAL OVERVIEW VIRTUAL MACHINES AND CONTAINERS Virtual Machine Container Application Application OS dependencies OS dependencies Operating System Container Host VM Isolation Container Isolation Complete OS Shared Kernel Static Compute Burstable Compute Static Memory Burstable Memory High Resource Usage Low Resource Usage 7 OPENSHIFT TECHNICAL OVERVIEW VIRTUAL MACHINES AND CONTAINERS Virtual Machine Container Application Clear ownership boundary Application Dev IT Ops OS dependencies between Dev and IT Ops OS dependencies (and Dev, sort of) drives DevOps adoption Operating System and fosters agility Container Host IT Ops Infrastructure Infrastructure Optimized for stability Optimized for agility 8 OPENSHIFT TECHNICAL OVERVIEW APPLICATION PORTABILITY WITH VM Virtual machines are NOT portable across hypervisor and do NOT provide portable packaging for applications Guest VM VM Type X VM Type Y VM Type Z Application Application Application Application Application OS dependencies OS dependencies OS dependencies OS dependencies OS dependencies Operating System Operating System Operating System Operating System Operating System LAPTOP BARE METAL VIRTUALIZATION PRIVATE CLOUD PUBLIC CLOUD 9 OPENSHIFT TECHNICAL OVERVIEW APPLICATION PORTABILITY WITH CONTAINERS RHEL Containers + RHEL Host = Guaranteed Portability Across Any Infrastructure Container Container Container Container Container Application Application Application Application Application OS dependencies OS dependencies OS dependencies OS dependencies OS dependencies RHEL RHEL RHEL RHEL RHEL Guest VM Virtual Machine Virtual Machine Virtual Machine LAPTOP BARE METAL VIRTUALIZATION PRIVATE CLOUD PUBLIC CLOUD 10 OPENSHIFT TECHNICAL OVERVIEW RAPID SECURITY PATCHING USING CONTAINER IMAGE LAYERING Image Layer 3 Application Layer Image Layer 2 Java Runtime Layer Image Layer 1 OS Update Layer Base Image Base RHEL Container Image Layers Example Container Image 11 OPENSHIFT TECHNICAL OVERVIEW A lightweight, OCI-compliant container runtime Any OCI-compliant Optimized for container from any Improve Security and Kubernetes OCI registry Performance at scale (including docker) Available in OpenShift Online (soon) Tech Preview in OCP 3.7, GA in OCP 3.8 12 OPENSHIFT TECHNICAL OVERVIEW OPENSHIFT ARCHITECTURE YOUR CHOICE OF INFRASTRUCTURE 14 OPENSHIFT TECHNICAL OVERVIEW NODES RHEL INSTANCES WHERE APPS RUN 15 OPENSHIFT TECHNICAL OVERVIEW APPS RUN IN CONTAINERS c 16 OPENSHIFT TECHNICAL OVERVIEW PODS ARE THE UNIT OF ORCHESTRATION c 17 OPENSHIFT TECHNICAL OVERVIEW MASTERS ARE THE CONTROL PLANE 18 OPENSHIFT TECHNICAL OVERVIEW API AND AUTHENTICATION 19 OPENSHIFT TECHNICAL OVERVIEW DESIRED AND CURRENT STATE 20 OPENSHIFT TECHNICAL OVERVIEW INTEGRATED CONTAINER REGISTRY 21 OPENSHIFT TECHNICAL OVERVIEW ORCHESTRATION AND SCHEDULING 22 OPENSHIFT TECHNICAL OVERVIEW PLACEMENT BY POLICY c 23 OPENSHIFT TECHNICAL OVERVIEW AUTOSCALING PODS c 24 OPENSHIFT TECHNICAL OVERVIEW SERVICE DISCOVERY c 25 OPENSHIFT TECHNICAL OVERVIEW PERSISTENT DATA IN CONTAINERS c 26 OPENSHIFT TECHNICAL OVERVIEW ROUTING AND LOAD-BALANCING c 27 OPENSHIFT TECHNICAL OVERVIEW ACCESS VIA WEB, CLI, IDE AND API c 28 OPENSHIFT TECHNICAL OVERVIEW TECHNICAL DEEP DIVE MONITORING APPLICATION HEALTH AUTO-HEALING FAILED PODS c c 31 OPENSHIFT TECHNICAL OVERVIEW AUTO-HEALING FAILED CONTAINERS c c 32 OPENSHIFT TECHNICAL OVERVIEW AUTO-HEALING FAILED CONTAINERS c c 33 OPENSHIFT TECHNICAL OVERVIEW AUTO-HEALING FAILED CONTAINERS c c 34 OPENSHIFT TECHNICAL OVERVIEW AUTO-HEALING FAILED CONTAINERS c c 35 OPENSHIFT TECHNICAL OVERVIEW NETWORKING BUILT-IN SERVICE DISCOVERY INTERNAL LOAD-BALANCING 37 OPENSHIFT TECHNICAL OVERVIEW BUILT-IN SERVICE DISCOVERY INTERNAL LOAD-BALANCING 38 OPENSHIFT TECHNICAL OVERVIEW ROUTE EXPOSES SERVICES EXTERNALLY 39 OPENSHIFT TECHNICAL OVERVIEW ROUTING AND EXTERNAL LOAD-BALANCING ● Pluggable routing architecture ○ HAProxy Router ○ F5 Router ● Multiple-routers with traffic sharding ● Router supported protocols ○ HTTP/HTTPS ○ WebSockets ○ TLS with SNI ● Non-standard ports via cloud load-balancers, external IP, and NodePort 40 OPENSHIFT TECHNICAL OVERVIEW ROUTE SPLIT TRAFFIC Split Traffic Between Multiple Services For A/B Testing, Blue/Green and Canary Deployments 41 OPENSHIFT TECHNICAL OVERVIEW EXTERNAL TRAFFIC TO A SERVICE ON A RANDOM PORT WITH NODEPORT ● NodePort binds a service to a unique port on all the nodes ● Traffic received on any node redirects to a node with the running service ● Ports in 30K-60K range which usually differs from the service ● Firewall rules must allow traffic to all nodes on the specific port 42 OPENSHIFT TECHNICAL OVERVIEW EXTERNAL TRAFFIC TO A SERVICE ON ANY PORT WITH INGRESS ● Access a service with an external IP on any TCP/UDP port, such as ○ Databases ○ Message Brokers ● Automatic IP allocation from a predefined pool using Ingress IP Self-Service ● IP failover pods provide high availability for the IP pool 43 OPENSHIFT TECHNICAL OVERVIEW CONTROL OUTGOING TRAFFIC SOURCE IP WITH EGRESS ROUTER 44 OPENSHIFT TECHNICAL OVERVIEW OPENSHIFT NETWORKING ● Built-in internal DNS to reach services by name ● Split DNS is supported via SkyDNS ○ Master answers DNS queries for internal services ○ Other nameservers serve the rest of the queries ● Software Defined Networking (SDN) for a unified cluster network to enable pod-to-pod communication ● OpenShift follows the Kubernetes Container Networking Interface (CNI) plug-in model 45 OPENSHIFT TECHNICAL OVERVIEW OPENSHIFT NETWORK PLUGINS * Flannel is minimally verified and is supported only and exactly as deployed in the OpenShift on OpenStack reference architecture 46 OPENSHIFT TECHNICAL OVERVIEW OPENSHIFT NETWORKING 47 OPENSHIFT TECHNICAL OVERVIEW OPENSHIFT SDN FLAT NETWORK (Default) ● All pods can communicate with each other across projects MULTI-TENANT NETWORK NODE NODE ● Project-level network isolation POD POD POD POD ● Multicast support ● Egress network policies POD POD POD POD NETWORK POLICY (Tech Preview) ● Granular policy-based isolation 48 OPENSHIFT TECHNICAL OVERVIEW OPENSHIFT SDN - NETWORK POLICY Example Policies ● Allow all traffic inside the project ● Allow traffic from green to gray ● Allow traffic to purple on 8080 apiVersion: extensions/v1beta1 kind: NetworkPolicy metadata: name: allow-to-purple-on-8080 spec: podSelector: matchLabels: color: purple ingress: - ports: - protocol: tcp port: 8080 49 OPENSHIFT TECHNICAL OVERVIEW OPENSHIFT SDN - OVS PACKET FLOW Container to Container on the Same Host 50 OPENSHIFT TECHNICAL OVERVIEW OPENSHIFT SDN - OVS PACKET FLOW Container to Container on the Different Hosts 51 OPENSHIFT TECHNICAL OVERVIEW OPENSHIFT SDN - OVS PACKET FLOW Container Connects to External Host 52 OPENSHIFT TECHNICAL OVERVIEW OPENSHIFT SDN WITH FLANNEL FOR OPENSTACK Flannel is minimally verified and is supported only and exactly as deployed in the OpenShift on OpenStack reference architecture https://access.redhat.com/articles/2743631 53 OPENSHIFT TECHNICAL OVERVIEW LOGGING & METRICS CENTRAL LOG MANAGEMENT WITH EFK ● EFK stack to aggregate logs for hosts and applications ○ Elasticsearch: an object store to store all logs ○ Fluentd: gathers logs and sends to Elasticsearch. ○ Kibana: A web UI for Elasticsearch. ● Access control ○ Cluster administrators can view all logs ○ Users can only view logs for their projects ● Ability to send logs elsewhere ○ External elasticsearch, Splunk, etc 55 OPENSHIFT TECHNICAL OVERVIEW CENTRAL LOG MANAGEMENT WITH EFK NODE POD POD NODE ELASTIC ELASTIC POD POD FLUENTD ELASTIC ELASTIC POD POD RHELNODE POD POD FLUENTD POD POD ELASTIC ELASTIC RHEL ELASTIC ELASTIC POD POD FLUENTD RHEL 56 OPENSHIFT TECHNICAL OVERVIEW CONTAINER METRICS 57 OPENSHIFT TECHNICAL OVERVIEW CONTAINER METRICS NODE POD POD NODE POD POD FLUENTD POD POD RHELNODE POD POD FLUENTD POD POD ELASTIC ELASTIC RHEL POD POD CADVISOR RHEL 58 OPENSHIFT TECHNICAL OVERVIEW SECURITY TEN LAYERS OF CONTAINER SECURITY Container Host & Multi-tenancy Federated Clusters Container Platform API Management Network Isolation Deploying Container Container Registry Container Content Storage Building Containers 60 OPENSHIFT TECHNICAL OVERVIEW SECRET MANAGEMENT ● Secure mechanism for holding sensitive data e.g. ○ Passwords and credentials ○ SSH Keys ○ Certificates ● Secrets are made available as ○ Environment variables ○ Volume mounts ○ Interaction with external systems ● Encrypted in transit ● Never rest on the nodes 61 OPENSHIFT TECHNICAL OVERVIEW PERSISTENT STORAGE PERSISTENT STORAGE ● Persistent Volume (PV) is tied to a piece of network storage ● Provisioned by an administrator (static or dynamically) ● Allows admins