Showing posts with label openshift. Show all posts
Showing posts with label openshift. Show all posts

Monday, April 25, 2022

DEVSECOPS: Openshift Basics & Setup

 

Reference: Devops with Dean -  https://www.youtube.com/watch?v=wm9AECTm_48

Openshift Flavors:

Openshift Origin - Opensource version

Openshift Online - Multi tenant cloud based container platform managed by RedHat.

Openshift Dedicated - Single tenant cloud based container platform managed by Redhat.

Openshift Container Platform - This software focus to deploy and manage on their own in an infrastructure of their own choice.

Openshift Community Distribution of Kubernetes - Optimized for Continuous Deployment of Application and multi tenant deployment


Pre-Requisites:

Need to have basic understanding of: 1. Docker    2. Kubernetes   

Basically, Kubernetes deploy Docker Containers and forms orchestration tasks.

Openshift on the other hand has tools which operate on underlying kubernetes components such as:

  1. SCM - code repo integration like gitlab, github
  2. Build - performed on application source code
  3. CICD pipeline - OpenShift uses Jenkins CICD pipeline
  4. Internal Registry - store local built images

Architecture:
First: Recap on uses of Kubernetes:-
There are containers that are deployed with deployment then a service object is created to expose this application to end-users.

Second: What does OpenShift provide:-
1. Web Console to define the underlying kubernetes resources
2. SCM Tools provide built-in support for Git to connect to a repository
3. Pipeline for CICD solutions to test, build, deploy apps
4. Built in image registry to push and pull container images, it provides out-of-the-box solution for users to manage images which they run their workloads.






OpenShift Setup:
  1. All-In-One (Good for learning)
  2. OneMaster-MultipleNode
  3. MultipleMaster-MultipleNode (Preferred for production-grade cluster)


Step 1: Install code ready containers (CRC)
CRC bring a minimal OpenShift cluster to the local computer.
This cluster provide minimal environment for developer and testing.
The main aim is to provide a running cluster to developers.
CRC includes containers with k8s components along with OpenShift tools 

Step 2: Download and install CRC binary (can get from RedHat website)

Step 3: Download pull secret (can get from RedHat website too)

Step 4: Extract the binary
tar -xvf <binaryfile>
a folder will be created.

Step 5: Copy the CRC folder (which is the binary) in the folder created above and move it to /usr/loca/bin
cd <foldercreatedinstep4>
sudo mv crc /usr/local/bin

Step 6: Setup CRC
need to cd to directory where pull secret is stored (in this case in downloads folder)
cd ~/Downloads
crc setup

Step 7: Set the pull secret
crc config set pull-secret-file pull-secret.txt

Step 8: Start the CRC
crc start 
This will take a bit of time.
This will also provide you with a URL link, 2 accounts (Administrator and User)

Step 9: Open CRC console in local system default browser
crc console 

Step 9.2: Open CRC console using the OC line
oc login -u developer <urllink>

Step 10: To stop or delete
crc stop
crc delete


Fluentd

Open-source log data collector > why logs? - for compliance (auditing, company, business) - for security (transparency, monitoring, admin...