2021 06 30 From Docker To Openshift
2021 06 30 From Docker To Openshift
2021 06 30 From Docker To Openshift
1
Contents
What you can expect from this talk
2
IT-Power Services
Bridging the gap between operations and applications
• Operations experts
• Power-house with high expertise
IBM i and Linux systems Operations
• CI/CD pipelines
• Docker, Podman, OpenShift
3
Background
4
Background: manage an online event
IT-PS Data Science Talk 2021
5
Demo: online event application
Landing page
6
Demo: online event application
Registration form
7
Demo: online event application
Django admin area
8
Demo: online event application
Mailer: create and send emails
9
Demo: online event application
Watch page
10
Tech stack: high level overview
Django application with PosgreSQL database behind Nginx
• Django
• Python based web framework
• Model-template-view pattern
• PosgreSQL DB
• Stores all relevant information for event
• Managed by Django
• Nginx
• Webserver
• UWSGI
• Web Server Gateway Interface
• Link between webserver and python
11
Containerisation and Orchestration
Docker Compose / Swarm
• 4 Services
• Application init
• Postgres
• Eventman (Python Django
Application)
• Nginx
• 1 Network
• Some services expose ports on
the host
• Some services read / write data
on disk
12
The deployment in OpenShift
Topology view from OpenShift
• 3 deployments
• Init deployment
• Should have been a pod
• See details later
• NGINX exposes service via
route
13
Moving from Docker to OpenShift
14
Kompose
Moving from yml to yml
15
Single service example
Code samples
16
Single service example
Python Flask API
17
Single service example
Python Flask API
19
Disadvantages of using Kompose
• Many options
• Deploy an image from a registry
• Import repo, build and deploy
•…
21
Using the OpenShift GUI
Import from Git
22
Using the OpenShift GUI
Import from Git
23
Using the OpenShift GUI
Resulting topology
24
Using the OpenShift GUI
Advantages and disadvantages
Advantages Disadvantages
• Easier to get familiar with • Hard to reproduce
concepts
• Easier to get overview of where
things go wrong
• Many obstacles more ironed out
• e.g. insecure registries
25
Challenges and possible solutions
26
Challenges in the process
New concepts in Kubernetes
• Tools like kompose or the OpenShift GUI can help to get familiar with
them
27
Challenges in the process
Image build using Buildah
28
Challenges in the process
File permissions
29
Challenges in the process
Exposing port(s) in container
30
Challenges in the process
TLS termination and SSL certificates
31
Challenges in the process
TLS termination and SSL certificates
• My question on stackoverflow is
still not fully answered
• https://stackoverflow.com/que
stions/66473285/x-forwarded-
for-headers-lost-when-
changing-openshift-route-
from-http-to-https
32
Summary
34