SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
Red Hat OpenShift Workshop
Deploy MySQL and Wordpress on CodeReady Containers
Mihai Criveti, Cloud Native Solutioning Leader, RHCE
November 23, 2020
1
OpenShift Workshop
CodeReady Containers
Project Configuration
Deploy MySQL
Wordpress
Scaling Applications
Next Steps
2
OpenShift Workshop
Scenario Overview
Figure 1: WordPress and MySQL on OpenShift
3
Steps
0. Test MySQL + Wordpress using podman.
1. Install CodeReady Containers
2. Create a project called wordpress
3. Create users and groups and setup htpassword authentication
• User admin as cluster admin
• developers:developer as edit for project
• leaders:leader as self-provisioner group
• testers:tester as view for project
4. Deploy mysql from registry.redhat.io/rhel8/mysql-80 and configure the secret
5. Deploy wordpress from docker.io/library/wordpress:5.5.0-php7.2-apache
6. Create a route and test wordpress
7. Scale
8. Setup probes and monitoring
4
Resources
• https://hub.docker.com/_/wordpress
• https://catalog.redhat.com/software/containers/rhel8/mysql-80/5ba0ad4cdd19c70b45cbf48c?container-
tabs=gti&gti-tabs=registry-tokens
5
CodeReady Containers
Install CodeReady Containers
Download CodeReady Containers
Go to http://cloud.redhat.com and download CodeReady Containers and the Pull Secret.
Unpack the archive
tar Jxf crc-linux-amd64.tar.xz
cd crc-linux-1.14.0-amd64
Setup CRC
./crc setup
./crc config set memory 16536
./crc config set cpus 8
./crc start
6
Deleting and Recreating your CRC
./crc stop
./crc delete
7
Connect to OCP
Setup the environment and autocomplete
eval $(./crc oc-env)
source <(oc completion zsh)
export API=https://api.crc.testing:6443
Get console info and login
./crc console --credentials
./crc console
export KUBEPASS=abcd
oc login -u kubeadmin -p $KUBEPASS $API
oc whoami; oc whoami --show-server
8
Setup users and OAuth
Create a random user password
export PASS=$(openssl rand -hex 15)
echo $PASS > password
Create users using htpasswd
yum provides htpasswd; sudo dnf install httpd-tools
htpasswd -c -b -B htpass-secret admin $PASS
htpasswd -b -B htpass-secret developer $PASS
htpasswd -b -B htpass-secret leader $PASS
htpasswd -b -B htpass-secret tester $PASS
cat htpass-secret
9
Setup secrets
Create OpenShift secrets in the openshift-config namespace
oc get secret/htpass-secret -n openshift-config
oc create secret generic htpass-secret -o yaml -n openshift-config 
--from-file=htpasswd=htpass-secret --dry-run | oc create -f -
oc create secret generic htpass-secret -o yaml -n openshift-config 
--from-file=htpasswd=htpass-secret --dry-run | oc replace -f -
oc extract secret/htpass-secret -n openshift-config --to - 
| tee htpass-secret
10
Setup cluster OAuth
Get oauth to edit
oc get oauth cluster -o yaml | tee oauth.yaml
11
Setup identityProviders
Edit oauth.yaml
spec:
identityProviders:
- htpasswd:
fileData:
name: htpass-secret
mappingMethod: claim
name: htpasswd_provider
type: HTPasswd
Apply
oc replace -f oauth.yaml
12
Setup cluster admin
Give the admin user cluster-admin permissions
oc adm policy add-cluster-role-to-user cluster-admin admin
Login as admin
oc login -u admin -p $PASS
oc login -u admin -p $PASS --loglevel 10 $API
oc whoami
13
Setup groups
Create groups
oc adm groups new leaders
oc adm groups new developers
oc adm groups new testers
oc get groups
Setup groups users
oc adm groups add-users leaders leader
oc adm groups add-users developers developer
oc adm groups add-users testers tester
oc get groups
14
Setup self-provisioning
Disable self-provisioning for all users
oc api-resources | grep rbac
oc get clusterrolebindings | grep self
oc describe clusterrolebindings self-provisioner
oc adm policy remove-cluster-role-from-group 
self-provisioner system:authenticated:oauth
Leaders can create projects
oc adm policy add-cluster-role-to-group self-provisioner leaders
15
Project Configuration
Create a project and setup policies
Create a new project and assign to developer
oc login -u leader -p $PASS $API
oc new-project wordpress
oc adm policy add-role-to-group edit developers
oc adm policy add-role-to-group view testers
oc login -u developer -p $PASS
16
Setup Quotas
oc create --save-config dev-quota.yaml
# or
oc create quota dev-quota --hard services=10,cpu=1300,memory=2Gi
oc get resource quota
oc describe quota
17
Deploy MySQL
Create a project and setup policies
Create a new project and assign to developer
oc login -u leader -p $PASS $API
oc new-project wordpress
oc adm policy add-role-to-group edit developers
oc adm policy add-role-to-group view testers
oc login -u developer -p $PASS
18
Deploy MySQL
Create a mysql secret
oc create secret generic mysql 
--from-literal database=wordpress 
--from-literal user=wpuser 
--from-literal password=password
Deploy MySQL from Red Hat
oc new-app --name mysql 
--docker-image=registry.redhat.io/rhel8/mysql-80 
--as-deployment-config=true
Check status - env is not yet set, app will crash
oc get dc,pod
oc status
oc logs pod/mysql-1-xxxxx
19
Configure my.cnf with ConfigMaps
Create a my.cnf file from the existing one
oc rsh mysql-2-hcstt cat /etc/my.cnf > my.cnf
echo 'default-authentication-plugin=mysql_native_password' >> my.cnf
Create a configmap
oc create configmap mysql-config --from-file my.cnf
oc set volume dc/mysql --add --name mysql-config --overwrite 
--type=configmap --configmap-name=mysql-config 
--mount-path=/etc/mysql-config
Check the settings
oc describe configmaps mysql-config
oc set volume dc --all
oc get all -l app=mysql
20
Configure the environment to use secrets
Set the environment to use the secret and config file
oc set env dc/mysql --from=secret/mysql 
--prefix=MYSQL_ DEFAULTS_FILE=/etc/mysql-config/my.cnf
oc set env pods --all --list
Get status
oc get dc,pod
oc status
oc logs pod/mysql-3-deploy
oc logs pod/mysql-3-xxxx
oc get all -l app=mysql
21
Test your database
Log into your container using oc rsh
oc rsh mysql-2-xxxxx
mysql -u wpuser --password=password wordpress -e 'show databases;'
exit
22
Wordpress
Deploy the Wordpress Pods
Deploy wordpress
oc new-app --name wordpress 
--docker-image docker.io/library/wordpress:5.5.0-php7.2-apache 
-e WORDPRESS_DB_HOST=mysql 
-e WORDPRESS_DB_NAME=wordpress 
-e WORDPRESS_DB_USER=wpuser 
-e WORDPRESS_DB_PASSWORD=password 
--as-deployment-config=true
Get status
oc get pod
oc logs pod/wordpress-1-7kf49
23
Create a service account
Create a service account
oc login -u admin -p $PASS
oc create sa wordpress-sa
oc adm policy add-scc-to-user anyuid -z wordpress-sa
Set wordpress-sa for the deploymentconfig
oc login -u developer -p $PASS
oc set serviceaccount deploymentconfig wordpress wordpress-sa
Get the status
oc get all
oc get events
oc logs pod/wordpress-2-468kp
24
Expose the application
Create a route
oc expose svc/wordpress
oc get routes
Setup WordPress
Go to http://wordpress-wordpress.apps-crc.testing/ to setup WordPress.
25
Cleanup
Deleting individual apps
oc delete all -l app=wordpress
oc delete all -l app=mysql
Deleting the entire project
oc delete projects wordpress
26
Debugging
Debug a deployment as root to check for permissions
oc debug -t deployment/wordpress --as-root
Replace the image
oc debug -t deployment/mysql 
--image registry.access.redehat.com/ubi/ubi:8.0
27
Scaling Applications
Manual Scaling
Get the dc
oc get dc
NAME REVISION DESIRED CURRENT
mysql 5 1 1
wordpress 2 1 1
Scale the dc
oc scale dc wordpress --replicas=3
oc get dc,pod
28
Create a PostgreSQL Operator using CLI
Operators
• MariaDB ?
• PostgreSQL
29
Next Steps
Next Steps
1. Add Health Checks
2. Scale up the application
3. Set up auto-scaling
4. Use a MySQL Operator to manage the database instead.
30

Contenu connexe

Tendances

The Linux Command Cheat Sheet
The Linux Command Cheat SheetThe Linux Command Cheat Sheet
The Linux Command Cheat SheetTola LENG
 
Deploy MySQL e Performance Tuning - 3º Zabbix Meetup do Interior
Deploy MySQL e Performance Tuning - 3º Zabbix Meetup do InteriorDeploy MySQL e Performance Tuning - 3º Zabbix Meetup do Interior
Deploy MySQL e Performance Tuning - 3º Zabbix Meetup do InteriorZabbix BR
 
OpenStack Architecture
OpenStack ArchitectureOpenStack Architecture
OpenStack ArchitectureMirantis
 
[오픈소스컨설팅]Zabbix Installation and Configuration Guide
[오픈소스컨설팅]Zabbix Installation and Configuration Guide[오픈소스컨설팅]Zabbix Installation and Configuration Guide
[오픈소스컨설팅]Zabbix Installation and Configuration GuideJi-Woong Choi
 
Primeiros passos com a API do Zabbix - Webinar JLCP
Primeiros passos com a API do Zabbix - Webinar JLCPPrimeiros passos com a API do Zabbix - Webinar JLCP
Primeiros passos com a API do Zabbix - Webinar JLCPRobert Silva
 
Zabbix + GLPI: Como estas duas ferramentas podem otimizar seus recursos
Zabbix + GLPI: Como estas duas ferramentas  podem otimizar seus recursosZabbix + GLPI: Como estas duas ferramentas  podem otimizar seus recursos
Zabbix + GLPI: Como estas duas ferramentas podem otimizar seus recursosJose Ferronato
 
Apache Spark Performance tuning and Best Practise
Apache Spark Performance tuning and Best PractiseApache Spark Performance tuning and Best Practise
Apache Spark Performance tuning and Best PractiseKnoldus Inc.
 
Workshop: Advanced Federation Use-Cases with PingFederate
Workshop: Advanced Federation Use-Cases with PingFederateWorkshop: Advanced Federation Use-Cases with PingFederate
Workshop: Advanced Federation Use-Cases with PingFederateCraig Wu
 
B+Tree Indexes and InnoDB
B+Tree Indexes and InnoDBB+Tree Indexes and InnoDB
B+Tree Indexes and InnoDBOvais Tariq
 
PostgreSQL Security. How Do We Think?
PostgreSQL Security. How Do We Think?PostgreSQL Security. How Do We Think?
PostgreSQL Security. How Do We Think?Ohyama Masanori
 
Building Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache KafkaBuilding Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache KafkaGuido Schmutz
 
Primeiros passos com a API do Zabbix
Primeiros passos com a API do ZabbixPrimeiros passos com a API do Zabbix
Primeiros passos com a API do ZabbixJanssen Lima
 
Beyond the Basics 4 MongoDB Security and Authentication
Beyond the Basics 4 MongoDB Security and AuthenticationBeyond the Basics 4 MongoDB Security and Authentication
Beyond the Basics 4 MongoDB Security and AuthenticationMongoDB
 
MariaDB Administrator 교육
MariaDB Administrator 교육 MariaDB Administrator 교육
MariaDB Administrator 교육 Sangmo Kim
 
Migrating ETL Workflow to Apache Spark at Scale in Pinterest
Migrating ETL Workflow to Apache Spark at Scale in PinterestMigrating ETL Workflow to Apache Spark at Scale in Pinterest
Migrating ETL Workflow to Apache Spark at Scale in PinterestDatabricks
 
[오픈테크넷서밋2022] 국내 PaaS(Kubernetes) Best Practice 및 DevOps 환경 구축 사례.pdf
[오픈테크넷서밋2022] 국내 PaaS(Kubernetes) Best Practice 및 DevOps 환경 구축 사례.pdf[오픈테크넷서밋2022] 국내 PaaS(Kubernetes) Best Practice 및 DevOps 환경 구축 사례.pdf
[오픈테크넷서밋2022] 국내 PaaS(Kubernetes) Best Practice 및 DevOps 환경 구축 사례.pdfOpen Source Consulting
 

Tendances (20)

The Linux Command Cheat Sheet
The Linux Command Cheat SheetThe Linux Command Cheat Sheet
The Linux Command Cheat Sheet
 
Deploy MySQL e Performance Tuning - 3º Zabbix Meetup do Interior
Deploy MySQL e Performance Tuning - 3º Zabbix Meetup do InteriorDeploy MySQL e Performance Tuning - 3º Zabbix Meetup do Interior
Deploy MySQL e Performance Tuning - 3º Zabbix Meetup do Interior
 
OpenStack Architecture
OpenStack ArchitectureOpenStack Architecture
OpenStack Architecture
 
[오픈소스컨설팅]Zabbix Installation and Configuration Guide
[오픈소스컨설팅]Zabbix Installation and Configuration Guide[오픈소스컨설팅]Zabbix Installation and Configuration Guide
[오픈소스컨설팅]Zabbix Installation and Configuration Guide
 
OAuth
OAuthOAuth
OAuth
 
Primeiros passos com a API do Zabbix - Webinar JLCP
Primeiros passos com a API do Zabbix - Webinar JLCPPrimeiros passos com a API do Zabbix - Webinar JLCP
Primeiros passos com a API do Zabbix - Webinar JLCP
 
Zabbix + GLPI: Como estas duas ferramentas podem otimizar seus recursos
Zabbix + GLPI: Como estas duas ferramentas  podem otimizar seus recursosZabbix + GLPI: Como estas duas ferramentas  podem otimizar seus recursos
Zabbix + GLPI: Como estas duas ferramentas podem otimizar seus recursos
 
Apache Spark Performance tuning and Best Practise
Apache Spark Performance tuning and Best PractiseApache Spark Performance tuning and Best Practise
Apache Spark Performance tuning and Best Practise
 
Workshop: Advanced Federation Use-Cases with PingFederate
Workshop: Advanced Federation Use-Cases with PingFederateWorkshop: Advanced Federation Use-Cases with PingFederate
Workshop: Advanced Federation Use-Cases with PingFederate
 
B+Tree Indexes and InnoDB
B+Tree Indexes and InnoDBB+Tree Indexes and InnoDB
B+Tree Indexes and InnoDB
 
PostgreSQL Security. How Do We Think?
PostgreSQL Security. How Do We Think?PostgreSQL Security. How Do We Think?
PostgreSQL Security. How Do We Think?
 
Building Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache KafkaBuilding Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache Kafka
 
Primeiros passos com a API do Zabbix
Primeiros passos com a API do ZabbixPrimeiros passos com a API do Zabbix
Primeiros passos com a API do Zabbix
 
Beyond the Basics 4 MongoDB Security and Authentication
Beyond the Basics 4 MongoDB Security and AuthenticationBeyond the Basics 4 MongoDB Security and Authentication
Beyond the Basics 4 MongoDB Security and Authentication
 
MariaDB Administrator 교육
MariaDB Administrator 교육 MariaDB Administrator 교육
MariaDB Administrator 교육
 
Migrating ETL Workflow to Apache Spark at Scale in Pinterest
Migrating ETL Workflow to Apache Spark at Scale in PinterestMigrating ETL Workflow to Apache Spark at Scale in Pinterest
Migrating ETL Workflow to Apache Spark at Scale in Pinterest
 
Openstack swift - VietOpenStack 6thmeeetup
Openstack swift - VietOpenStack 6thmeeetupOpenstack swift - VietOpenStack 6thmeeetup
Openstack swift - VietOpenStack 6thmeeetup
 
Red Hat Insights
Red Hat InsightsRed Hat Insights
Red Hat Insights
 
Learning postgresql
Learning postgresqlLearning postgresql
Learning postgresql
 
[오픈테크넷서밋2022] 국내 PaaS(Kubernetes) Best Practice 및 DevOps 환경 구축 사례.pdf
[오픈테크넷서밋2022] 국내 PaaS(Kubernetes) Best Practice 및 DevOps 환경 구축 사례.pdf[오픈테크넷서밋2022] 국내 PaaS(Kubernetes) Best Practice 및 DevOps 환경 구축 사례.pdf
[오픈테크넷서밋2022] 국내 PaaS(Kubernetes) Best Practice 및 DevOps 환경 구축 사례.pdf
 

Similaire à Kubernetes Story - Day 3: Deploying and Scaling Applications on OpenShift

[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context ConstraintsAlessandro Arrichiello
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Ben Hall
 
Wordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccionWordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccionSysdig
 
Software Defined Datacenter
Software Defined DatacenterSoftware Defined Datacenter
Software Defined DatacenterNETWAYS
 
Take Command of WordPress With WP-CLI
Take Command of WordPress With WP-CLITake Command of WordPress With WP-CLI
Take Command of WordPress With WP-CLIDiana Thompson
 
Docker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak PeekDocker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak Peekmsyukor
 
Introduction to WP-CLI: Manage WordPress from the command line
Introduction to WP-CLI: Manage WordPress from the command lineIntroduction to WP-CLI: Manage WordPress from the command line
Introduction to WP-CLI: Manage WordPress from the command lineBehzod Saidov
 
Enrique lima azure-it-pro-ps
Enrique lima azure-it-pro-psEnrique lima azure-it-pro-ps
Enrique lima azure-it-pro-psEnrique Lima
 
Kubernetes Story - Day 1: Build and Manage Containers with Podman
Kubernetes Story - Day 1: Build and Manage Containers with PodmanKubernetes Story - Day 1: Build and Manage Containers with Podman
Kubernetes Story - Day 1: Build and Manage Containers with PodmanMihai Criveti
 
Automated Server Administration for DevSecOps
Automated Server Administration for DevSecOpsAutomated Server Administration for DevSecOps
Automated Server Administration for DevSecOpsAarno Aukia
 
Take Command of WordPress With WP-CLI
Take Command of WordPress With WP-CLITake Command of WordPress With WP-CLI
Take Command of WordPress With WP-CLIDiana Thompson
 
Introduction To Managing VMware With PowerShell
Introduction To Managing VMware With PowerShellIntroduction To Managing VMware With PowerShell
Introduction To Managing VMware With PowerShellHal Rottenberg
 
VCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environmentVCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environmentTakayuki Miyauchi
 
Take Command of WordPress With WP-CLI at WordCamp Long Beach
Take Command of WordPress With WP-CLI at WordCamp Long BeachTake Command of WordPress With WP-CLI at WordCamp Long Beach
Take Command of WordPress With WP-CLI at WordCamp Long BeachDiana Thompson
 
Infrastructure = code - 1 year later
Infrastructure = code - 1 year laterInfrastructure = code - 1 year later
Infrastructure = code - 1 year laterChristian Ortner
 
Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)Yuriy Senko
 
Nginx 0.8.x 安装手册
Nginx 0.8.x 安装手册Nginx 0.8.x 安装手册
Nginx 0.8.x 安装手册Yiwei Ma
 
桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作Philip Zheng
 

Similaire à Kubernetes Story - Day 3: Deploying and Scaling Applications on OpenShift (20)

[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
 
Wordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccionWordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccion
 
Simple docker hosting in FIWARE Lab
Simple docker hosting in FIWARE LabSimple docker hosting in FIWARE Lab
Simple docker hosting in FIWARE Lab
 
Software Defined Datacenter
Software Defined DatacenterSoftware Defined Datacenter
Software Defined Datacenter
 
Intalacion de owncloud
Intalacion de owncloudIntalacion de owncloud
Intalacion de owncloud
 
Take Command of WordPress With WP-CLI
Take Command of WordPress With WP-CLITake Command of WordPress With WP-CLI
Take Command of WordPress With WP-CLI
 
Docker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak PeekDocker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak Peek
 
Introduction to WP-CLI: Manage WordPress from the command line
Introduction to WP-CLI: Manage WordPress from the command lineIntroduction to WP-CLI: Manage WordPress from the command line
Introduction to WP-CLI: Manage WordPress from the command line
 
Enrique lima azure-it-pro-ps
Enrique lima azure-it-pro-psEnrique lima azure-it-pro-ps
Enrique lima azure-it-pro-ps
 
Kubernetes Story - Day 1: Build and Manage Containers with Podman
Kubernetes Story - Day 1: Build and Manage Containers with PodmanKubernetes Story - Day 1: Build and Manage Containers with Podman
Kubernetes Story - Day 1: Build and Manage Containers with Podman
 
Automated Server Administration for DevSecOps
Automated Server Administration for DevSecOpsAutomated Server Administration for DevSecOps
Automated Server Administration for DevSecOps
 
Take Command of WordPress With WP-CLI
Take Command of WordPress With WP-CLITake Command of WordPress With WP-CLI
Take Command of WordPress With WP-CLI
 
Introduction To Managing VMware With PowerShell
Introduction To Managing VMware With PowerShellIntroduction To Managing VMware With PowerShell
Introduction To Managing VMware With PowerShell
 
VCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environmentVCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environment
 
Take Command of WordPress With WP-CLI at WordCamp Long Beach
Take Command of WordPress With WP-CLI at WordCamp Long BeachTake Command of WordPress With WP-CLI at WordCamp Long Beach
Take Command of WordPress With WP-CLI at WordCamp Long Beach
 
Infrastructure = code - 1 year later
Infrastructure = code - 1 year laterInfrastructure = code - 1 year later
Infrastructure = code - 1 year later
 
Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)
 
Nginx 0.8.x 安装手册
Nginx 0.8.x 安装手册Nginx 0.8.x 安装手册
Nginx 0.8.x 安装手册
 
桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作
 

Plus de Mihai Criveti

10 Limitations of Large Language Models and Mitigation Options
10 Limitations of Large Language Models and Mitigation Options10 Limitations of Large Language Models and Mitigation Options
10 Limitations of Large Language Models and Mitigation OptionsMihai Criveti
 
Retrieval Augmented Generation in Practice: Scalable GenAI platforms with k8s...
Retrieval Augmented Generation in Practice: Scalable GenAI platforms with k8s...Retrieval Augmented Generation in Practice: Scalable GenAI platforms with k8s...
Retrieval Augmented Generation in Practice: Scalable GenAI platforms with k8s...Mihai Criveti
 
Ansible Workshop for Pythonistas
Ansible Workshop for PythonistasAnsible Workshop for Pythonistas
Ansible Workshop for PythonistasMihai Criveti
 
Mihai Criveti - PyCon Ireland - Automate Everything
Mihai Criveti - PyCon Ireland - Automate EverythingMihai Criveti - PyCon Ireland - Automate Everything
Mihai Criveti - PyCon Ireland - Automate EverythingMihai Criveti
 
Data Science at Scale - The DevOps Approach
Data Science at Scale - The DevOps ApproachData Science at Scale - The DevOps Approach
Data Science at Scale - The DevOps ApproachMihai Criveti
 
ShipItCon - Continuous Deployment and Multicloud with Ansible and Kubernetes
ShipItCon - Continuous Deployment and Multicloud with Ansible and KubernetesShipItCon - Continuous Deployment and Multicloud with Ansible and Kubernetes
ShipItCon - Continuous Deployment and Multicloud with Ansible and KubernetesMihai Criveti
 
DevOps for Data Engineers - Automate Your Data Science Pipeline with Ansible,...
DevOps for Data Engineers - Automate Your Data Science Pipeline with Ansible,...DevOps for Data Engineers - Automate Your Data Science Pipeline with Ansible,...
DevOps for Data Engineers - Automate Your Data Science Pipeline with Ansible,...Mihai Criveti
 
OpenShift Virtualization - VM and OS Image Lifecycle
OpenShift Virtualization - VM and OS Image LifecycleOpenShift Virtualization - VM and OS Image Lifecycle
OpenShift Virtualization - VM and OS Image LifecycleMihai Criveti
 
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...Mihai Criveti
 
Container Technologies and Transformational value
Container Technologies and Transformational valueContainer Technologies and Transformational value
Container Technologies and Transformational valueMihai Criveti
 
OpenShift Commons - Adopting Podman, Skopeo and Buildah for Building and Mana...
OpenShift Commons - Adopting Podman, Skopeo and Buildah for Building and Mana...OpenShift Commons - Adopting Podman, Skopeo and Buildah for Building and Mana...
OpenShift Commons - Adopting Podman, Skopeo and Buildah for Building and Mana...Mihai Criveti
 
AnsibleFest 2021 - DevSecOps with Ansible, OpenShift Virtualization, Packer a...
AnsibleFest 2021 - DevSecOps with Ansible, OpenShift Virtualization, Packer a...AnsibleFest 2021 - DevSecOps with Ansible, OpenShift Virtualization, Packer a...
AnsibleFest 2021 - DevSecOps with Ansible, OpenShift Virtualization, Packer a...Mihai Criveti
 

Plus de Mihai Criveti (12)

10 Limitations of Large Language Models and Mitigation Options
10 Limitations of Large Language Models and Mitigation Options10 Limitations of Large Language Models and Mitigation Options
10 Limitations of Large Language Models and Mitigation Options
 
Retrieval Augmented Generation in Practice: Scalable GenAI platforms with k8s...
Retrieval Augmented Generation in Practice: Scalable GenAI platforms with k8s...Retrieval Augmented Generation in Practice: Scalable GenAI platforms with k8s...
Retrieval Augmented Generation in Practice: Scalable GenAI platforms with k8s...
 
Ansible Workshop for Pythonistas
Ansible Workshop for PythonistasAnsible Workshop for Pythonistas
Ansible Workshop for Pythonistas
 
Mihai Criveti - PyCon Ireland - Automate Everything
Mihai Criveti - PyCon Ireland - Automate EverythingMihai Criveti - PyCon Ireland - Automate Everything
Mihai Criveti - PyCon Ireland - Automate Everything
 
Data Science at Scale - The DevOps Approach
Data Science at Scale - The DevOps ApproachData Science at Scale - The DevOps Approach
Data Science at Scale - The DevOps Approach
 
ShipItCon - Continuous Deployment and Multicloud with Ansible and Kubernetes
ShipItCon - Continuous Deployment and Multicloud with Ansible and KubernetesShipItCon - Continuous Deployment and Multicloud with Ansible and Kubernetes
ShipItCon - Continuous Deployment and Multicloud with Ansible and Kubernetes
 
DevOps for Data Engineers - Automate Your Data Science Pipeline with Ansible,...
DevOps for Data Engineers - Automate Your Data Science Pipeline with Ansible,...DevOps for Data Engineers - Automate Your Data Science Pipeline with Ansible,...
DevOps for Data Engineers - Automate Your Data Science Pipeline with Ansible,...
 
OpenShift Virtualization - VM and OS Image Lifecycle
OpenShift Virtualization - VM and OS Image LifecycleOpenShift Virtualization - VM and OS Image Lifecycle
OpenShift Virtualization - VM and OS Image Lifecycle
 
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
 
Container Technologies and Transformational value
Container Technologies and Transformational valueContainer Technologies and Transformational value
Container Technologies and Transformational value
 
OpenShift Commons - Adopting Podman, Skopeo and Buildah for Building and Mana...
OpenShift Commons - Adopting Podman, Skopeo and Buildah for Building and Mana...OpenShift Commons - Adopting Podman, Skopeo and Buildah for Building and Mana...
OpenShift Commons - Adopting Podman, Skopeo and Buildah for Building and Mana...
 
AnsibleFest 2021 - DevSecOps with Ansible, OpenShift Virtualization, Packer a...
AnsibleFest 2021 - DevSecOps with Ansible, OpenShift Virtualization, Packer a...AnsibleFest 2021 - DevSecOps with Ansible, OpenShift Virtualization, Packer a...
AnsibleFest 2021 - DevSecOps with Ansible, OpenShift Virtualization, Packer a...
 

Dernier

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 

Dernier (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 

Kubernetes Story - Day 3: Deploying and Scaling Applications on OpenShift

  • 1. Red Hat OpenShift Workshop Deploy MySQL and Wordpress on CodeReady Containers Mihai Criveti, Cloud Native Solutioning Leader, RHCE November 23, 2020 1
  • 2. OpenShift Workshop CodeReady Containers Project Configuration Deploy MySQL Wordpress Scaling Applications Next Steps 2
  • 4. Scenario Overview Figure 1: WordPress and MySQL on OpenShift 3
  • 5. Steps 0. Test MySQL + Wordpress using podman. 1. Install CodeReady Containers 2. Create a project called wordpress 3. Create users and groups and setup htpassword authentication • User admin as cluster admin • developers:developer as edit for project • leaders:leader as self-provisioner group • testers:tester as view for project 4. Deploy mysql from registry.redhat.io/rhel8/mysql-80 and configure the secret 5. Deploy wordpress from docker.io/library/wordpress:5.5.0-php7.2-apache 6. Create a route and test wordpress 7. Scale 8. Setup probes and monitoring 4
  • 8. Install CodeReady Containers Download CodeReady Containers Go to http://cloud.redhat.com and download CodeReady Containers and the Pull Secret. Unpack the archive tar Jxf crc-linux-amd64.tar.xz cd crc-linux-1.14.0-amd64 Setup CRC ./crc setup ./crc config set memory 16536 ./crc config set cpus 8 ./crc start 6
  • 9. Deleting and Recreating your CRC ./crc stop ./crc delete 7
  • 10. Connect to OCP Setup the environment and autocomplete eval $(./crc oc-env) source <(oc completion zsh) export API=https://api.crc.testing:6443 Get console info and login ./crc console --credentials ./crc console export KUBEPASS=abcd oc login -u kubeadmin -p $KUBEPASS $API oc whoami; oc whoami --show-server 8
  • 11. Setup users and OAuth Create a random user password export PASS=$(openssl rand -hex 15) echo $PASS > password Create users using htpasswd yum provides htpasswd; sudo dnf install httpd-tools htpasswd -c -b -B htpass-secret admin $PASS htpasswd -b -B htpass-secret developer $PASS htpasswd -b -B htpass-secret leader $PASS htpasswd -b -B htpass-secret tester $PASS cat htpass-secret 9
  • 12. Setup secrets Create OpenShift secrets in the openshift-config namespace oc get secret/htpass-secret -n openshift-config oc create secret generic htpass-secret -o yaml -n openshift-config --from-file=htpasswd=htpass-secret --dry-run | oc create -f - oc create secret generic htpass-secret -o yaml -n openshift-config --from-file=htpasswd=htpass-secret --dry-run | oc replace -f - oc extract secret/htpass-secret -n openshift-config --to - | tee htpass-secret 10
  • 13. Setup cluster OAuth Get oauth to edit oc get oauth cluster -o yaml | tee oauth.yaml 11
  • 14. Setup identityProviders Edit oauth.yaml spec: identityProviders: - htpasswd: fileData: name: htpass-secret mappingMethod: claim name: htpasswd_provider type: HTPasswd Apply oc replace -f oauth.yaml 12
  • 15. Setup cluster admin Give the admin user cluster-admin permissions oc adm policy add-cluster-role-to-user cluster-admin admin Login as admin oc login -u admin -p $PASS oc login -u admin -p $PASS --loglevel 10 $API oc whoami 13
  • 16. Setup groups Create groups oc adm groups new leaders oc adm groups new developers oc adm groups new testers oc get groups Setup groups users oc adm groups add-users leaders leader oc adm groups add-users developers developer oc adm groups add-users testers tester oc get groups 14
  • 17. Setup self-provisioning Disable self-provisioning for all users oc api-resources | grep rbac oc get clusterrolebindings | grep self oc describe clusterrolebindings self-provisioner oc adm policy remove-cluster-role-from-group self-provisioner system:authenticated:oauth Leaders can create projects oc adm policy add-cluster-role-to-group self-provisioner leaders 15
  • 19. Create a project and setup policies Create a new project and assign to developer oc login -u leader -p $PASS $API oc new-project wordpress oc adm policy add-role-to-group edit developers oc adm policy add-role-to-group view testers oc login -u developer -p $PASS 16
  • 20. Setup Quotas oc create --save-config dev-quota.yaml # or oc create quota dev-quota --hard services=10,cpu=1300,memory=2Gi oc get resource quota oc describe quota 17
  • 22. Create a project and setup policies Create a new project and assign to developer oc login -u leader -p $PASS $API oc new-project wordpress oc adm policy add-role-to-group edit developers oc adm policy add-role-to-group view testers oc login -u developer -p $PASS 18
  • 23. Deploy MySQL Create a mysql secret oc create secret generic mysql --from-literal database=wordpress --from-literal user=wpuser --from-literal password=password Deploy MySQL from Red Hat oc new-app --name mysql --docker-image=registry.redhat.io/rhel8/mysql-80 --as-deployment-config=true Check status - env is not yet set, app will crash oc get dc,pod oc status oc logs pod/mysql-1-xxxxx 19
  • 24. Configure my.cnf with ConfigMaps Create a my.cnf file from the existing one oc rsh mysql-2-hcstt cat /etc/my.cnf > my.cnf echo 'default-authentication-plugin=mysql_native_password' >> my.cnf Create a configmap oc create configmap mysql-config --from-file my.cnf oc set volume dc/mysql --add --name mysql-config --overwrite --type=configmap --configmap-name=mysql-config --mount-path=/etc/mysql-config Check the settings oc describe configmaps mysql-config oc set volume dc --all oc get all -l app=mysql 20
  • 25. Configure the environment to use secrets Set the environment to use the secret and config file oc set env dc/mysql --from=secret/mysql --prefix=MYSQL_ DEFAULTS_FILE=/etc/mysql-config/my.cnf oc set env pods --all --list Get status oc get dc,pod oc status oc logs pod/mysql-3-deploy oc logs pod/mysql-3-xxxx oc get all -l app=mysql 21
  • 26. Test your database Log into your container using oc rsh oc rsh mysql-2-xxxxx mysql -u wpuser --password=password wordpress -e 'show databases;' exit 22
  • 28. Deploy the Wordpress Pods Deploy wordpress oc new-app --name wordpress --docker-image docker.io/library/wordpress:5.5.0-php7.2-apache -e WORDPRESS_DB_HOST=mysql -e WORDPRESS_DB_NAME=wordpress -e WORDPRESS_DB_USER=wpuser -e WORDPRESS_DB_PASSWORD=password --as-deployment-config=true Get status oc get pod oc logs pod/wordpress-1-7kf49 23
  • 29. Create a service account Create a service account oc login -u admin -p $PASS oc create sa wordpress-sa oc adm policy add-scc-to-user anyuid -z wordpress-sa Set wordpress-sa for the deploymentconfig oc login -u developer -p $PASS oc set serviceaccount deploymentconfig wordpress wordpress-sa Get the status oc get all oc get events oc logs pod/wordpress-2-468kp 24
  • 30. Expose the application Create a route oc expose svc/wordpress oc get routes Setup WordPress Go to http://wordpress-wordpress.apps-crc.testing/ to setup WordPress. 25
  • 31. Cleanup Deleting individual apps oc delete all -l app=wordpress oc delete all -l app=mysql Deleting the entire project oc delete projects wordpress 26
  • 32. Debugging Debug a deployment as root to check for permissions oc debug -t deployment/wordpress --as-root Replace the image oc debug -t deployment/mysql --image registry.access.redehat.com/ubi/ubi:8.0 27
  • 34. Manual Scaling Get the dc oc get dc NAME REVISION DESIRED CURRENT mysql 5 1 1 wordpress 2 1 1 Scale the dc oc scale dc wordpress --replicas=3 oc get dc,pod 28
  • 35. Create a PostgreSQL Operator using CLI Operators • MariaDB ? • PostgreSQL 29
  • 37. Next Steps 1. Add Health Checks 2. Scale up the application 3. Set up auto-scaling 4. Use a MySQL Operator to manage the database instead. 30