#+TODO: TODO(t) NEXT(n) WAITING(w) SOMEDAY(s) DELEGATED(g) PROJ(p) PLANNED(l) | DONE(d) FORWARDED(f) CANCELLED(c)
|
#+PRIORITIES: A D D
|
#+OPTIONS: H:1 author:nil toc:nil date:nil t:nil <:t e:t p:t num:nil
|
#+TITLE: OpenShift Diagrams by Olaf Bohlen
|
#+LaTeX_CLASS: article
|
#+LaTeX_HEADER: \usepackage[ttscale=.875]{libertine}
|
#+LaTeX_HEADER: \usepackage{sectsty}
|
#+LaTeX_HEADER: \sectionfont{\normalfont\scshape}
|
#+LaTeX_HEADER: \subsectionfont{\normalfont\itshape}
|
#+LATEX_HEADER: \renewcommand\maketitle{}
|
|
* Deployment on OpenShift with images using Kubernetes Deployments
|
|
#+BEGIN_SRC ditaa :file ocp-dep-image1.png :cmdline -r
|
oc new-app sample.registry.org/user/image:tag
|
|
|
|
|
| (1) +-------------+ points to +------------------------------------+
|
+---> | ImageStream | -----------> | external Registry cRED {s} |
|
| | (IS) | | sample.registry.org/user/image:tag |
|
| +-------------+ +------------------------------------+
|
| ^
|
| | points to
|
| (2) +------------------+ (5) creates +-----------------------+
|
+---> | Deployment | --------------------------------> | ReplicaSet |
|
| | | (4) | |
|
| | | -------------------+ +-----------------------+
|
| +------------------+ creates | |
|
| | |scales &
|
| v |monitors
|
| (3) +---------+ load balances +----------------+ |
|
+---> | Service | --------------> | ApplicationPod | <-------------+
|
| (SVC) | | |
|
+---------+ +----------------+
|
#+END_SRC
|
|
* Deployment on OpenShift with images using OpenShift DeploymentConfigs (dc)
|
|
#+BEGIN_SRC ditaa :file ocp-dep-image2.png :cmdline -r
|
oc new-app sample.registry.org/user/image:tag
|
|
|
|
|
| (1) +-------------+ points to +------------------------------------+
|
+---> | ImageStream | -----------> | external Registry cRED {s} |
|
| | (IS) | | sample.registry.org/user/image:tag |
|
| +-------------+ +------------------------------------+
|
| ^
|
| | points to
|
| (2) +------------------+ (5) creates +-----------------------+
|
+---> | DeploymentConfig | --------------------------------> | ReplicationController |
|
| | (DC) | (4) +-----------+ | (RC) |
|
| | | ---------> | DeployPod | +-----------------------+
|
| +------------------+ creates +-----------+ |
|
| | (6) creates |scales &
|
| v |monitors
|
| (3) +---------+ load balances +----------------+ |
|
+---> | Service | --------------> | ApplicationPod | <-------------+
|
| (SVC) | | |
|
+---------+ +----------------+
|
#+END_SRC
|
|
#+results:
|
[[file:ocp-dep-image1.png]]
|
|
* Deployment on OpenShift with Source-to-Image (S2I) using Kubernetes Deployments
|
|
#+BEGIN_SRC ditaa :file ocp-dep-s2i1.png :cmdline -rE
|
oc new-app http://git.repo-server.org/sampleapp
|
|
|
|
|
| (1) +-------------+ points to +----------------------------+ +------------------------------------+
|
+---> | ImageStream | -----------> | internal Registry cBLU {s} | | external Registry cRED {s} |
|
| | (IS) |<+ | sampleapp:latest | | sample.registry.org/ose/s2ibuilder |
|
| +-------------+ | +----------------------------+ +------------------------------------+
|
| | ^ ^
|
| | | (9) docker commits | points to
|
| | | |
|
| (2) +-------------+ |(5) creates +--------------+ (6) docker run +-----------------+
|
+---> | BuildConfig | |-----------> | BuilderPod | ------------------> | S2I ImageStream |
|
| | (BC) | | | (8) assemble | | (IS) |
|
| +-------------+ | +--------------+ +-----------------+
|
| | | | (7) git clone ^
|
| +--=-----|----=-------------|---=----------------------------------+
|
| ImageChange | |
|
| Trigger watches| v
|
| S2I IS | +--------------------------------------+
|
| | | git Repository {s} |
|
build | | | http://git.repo-server.org/sampleapp |
|
step | : +--------------------------------------+
|
-=-----|-=--------------------|--=-------------------------------------------------------------------------------------
|
deploy | |ImageChange
|
step | |Trigger
|
| |watches IS
|
| (3) +------------------+ (11) creates +-----------------------+
|
+---> | Deployment | --------------------------------> | ReplicaSet |
|
| | | (10) | |
|
| | | -------------------+ +-----------------------+
|
| +------------------+ creates | |
|
| | |scales &
|
| v |monitors
|
| (4) +---------+ load balances +----------------+ |
|
+---> | Service | --------------> | ApplicationPod | <-------------+
|
| (SVC) | | |
|
+---------+ +----------------+
|
#+END_SRC
|
|
|
* Deployment on OpenShift with Source-to-Image (S2I) using DeploymentConfigs (dc)
|
|
#+BEGIN_SRC ditaa :file ocp-dep-s2i2.png :cmdline -rE
|
oc new-app http://git.repo-server.org/sampleapp
|
|
|
|
|
| (1) +-------------+ points to +----------------------------+ +------------------------------------+
|
+---> | ImageStream | -----------> | internal Registry cBLU {s} | | external Registry cRED {s} |
|
| | (IS) |<+ | sampleapp:latest | | sample.registry.org/ose/s2ibuilder |
|
| +-------------+ | +----------------------------+ +------------------------------------+
|
| | ^ ^
|
| | | (9) docker commits | points to
|
| | | |
|
| (2) +-------------+ |(5) creates +--------------+ (6) docker run +-----------------+
|
+---> | BuildConfig | |-----------> | BuilderPod | ------------------> | S2I ImageStream |
|
| | (BC) | | | (8) assemble | | (IS) |
|
| +-------------+ | +--------------+ +-----------------+
|
| | | | (7) git clone ^
|
| +--=-----|----=-------------|---=----------------------------------+
|
| ImageChange | |
|
| Trigger watches| v
|
| S2I IS | +--------------------------------------+
|
| | | git Repository {s} |
|
build | | | http://git.repo-server.org/sampleapp |
|
step | : +--------------------------------------+
|
-=-----|-=--------------------|--=-------------------------------------------------------------------------------------
|
deploy | |ImageChange
|
step | |Trigger
|
| |watches IS
|
| (3) +------------------+ (11) creates +-----------------------+
|
+---> | DeploymentConfig | --------------------------------> | ReplicationController |
|
| | (DC) | (10) +-----------+ | (RC) |
|
| | | ---------> | DeployPod | +-----------------------+
|
| +------------------+ creates +-----------+ |
|
| | (12) creates |scales &
|
| v |monitors
|
| (4) +---------+ load balances +----------------+ |
|
+---> | Service | --------------> | ApplicationPod | <-------------+
|
| (SVC) | | |
|
+---------+ +----------------+
|
#+END_SRC
|
|
#+results:
|
[[file:ocp-dep-s2i1.png]]
|
|
* Input Detection OpenShift
|
#+begin_src plantuml :file openshift-input-detection.png
|
!pragma useVerticalIf on
|
:oc new-app <input spec>;
|
if (docker pull) then (yes)
|
-> yes
|
--docker-image= forces this;
|
:docker run;
|
note: --docker-image= forces this
|
stop
|
else (no)
|
:try for an SCM code repo;
|
note: --code forces this
|
if (git clone) then (no)
|
:abort with error;
|
stop
|
elseif (Dockerfile found?) then (yes)
|
:docker build;
|
note: --strategy=docker forces this
|
:docker run;
|
stop
|
else (no)
|
:continue with S2I;
|
note right: --strategy=source forces this
|
if (pom.xml found?) then (yes)
|
:search for JEE S2I builder;
|
note: use -i to suggest an S2I image stream (tag);
|
:continue with S2I process;
|
stop
|
elseif (index.php found?) then (yes)
|
:search for PHP S2I builder;
|
note
|
prefix the git url with builderis~ (tilda!)
|
to turn off language detection and force this builder
|
end note
|
:continue with S2I process;
|
stop
|
else
|
:abort with error;
|
stop
|
endif
|
#+end_src
|
|
#+results:
|
[[file:openshift-input-detection.png]]
|