Saturday, February 17, 2024

Kubernetes Terminologies

 CRI - Container Runtime Interface

OCI - Open Container Initiative (has imagespec, runtimespec)

ContainerD - comes with CLI ctl (docker vs containerd?)

kublet - [Register Node, create PODs, Monitor Node & PODs). Registers the node to kubernetes cluster. It requests the container runtime engine like docker to pull container image on to the node to run pods. Monitors node & pods

Kube-Proxy - Network traffic between PODs

Services - Enable kube apps to be accessible outside cluster. 2 service types, They have an IP address

NodePort: Maps a port on the node to the Port on the pod

ClusterIP: Communication between pods within the cluster. Apps->DBs

LoadBalancer - Kube native load balancer

CNI - Container Network Interface






Reactjs Application Deployment In Azure storage Account

 1. Create an Azure storage account

2. From Settings of created storage account, select 'configuration', a) select 'Disabled' for 'Secure transfer required' -> this enables http. b) select 'Enabled' for 'Allow Blob anonymous access'

3. Save the changes

4. Under 'Data Storage', click on Containers, create a container with access level as Blob(anonymous read access for blobs only)

5. Using Upload under container, upload a file called index.hmtl which I have attached/shared.

6. create a 'Front Door and CDN' and do this, search for 'Front Door and CDN profiles', and click +Create button, select Exlore other offerings and Azure CDN Standard from Microsoft (classic). Provide resource group name and cdn profile name (ex: cdn-profile)

7. Next, create an Endpoint. To do this, click on cdn-profile you created and click on +Endpoint, provide Endpoint name (Ex: myreactapp), and choose Storage under Origin type. Select Origin hostname from dropdown (ex: mystorageaccount.blob.core.windows.net)

8. Now, select the Endpoint you created and click on 'Rule Engine' that appears in Settings

9. choose Add rules button under EndPoint. Now give a name to rules and Click on Add Condition and select 'URL File Extension', choose Operator 'less than' and Extension as 1 and case transform as No transform. Then click on the “Add action” button and select “URL rewrite” action. 

10. Click on Save button.

11. Now select container that you created under storage account and click Upload button and upload index.html OR your reacjs app after running npm build

12. Now you click on Endpoint created and click Endpoint hostname (ex: https://reactjsapp.azureedge.net) to open the hosted/deployed app in browser.

Thursday, February 15, 2024

How to create ARO(Azure Redhat OpenShift) private cluster

Register to azure redhat 

az account set --subscription 7ce96666-9c91-4251-a956-c0bbc4617409 
az provider register -n Microsoft.RedHatOpenShift --wait 
az provider register -n Microsoft.Compute --wait 
az provider register -n Microsoft.Network --wait 
az provider register -n Microsoft.Storage --wait 

 Envirinment variables: 

LOCATION=eastus # the location of your cluster 
RESOURCEGROUP="v4-$LOCATION" # the name of the resource group where you want to create your cluster 
CLUSTER=aro-cluster # the name of your cluster 

 az group create --name $RESOURCEGROUP --location $LOCATION 

 Create a virtual network.

 az network vnet create --resource-group $RESOURCEGROUP --name aro-vnet --address-prefixes 10.0.0.0/22 

 Add an empty subnet for the master nodes. 

 az network vnet subnet create --resource-group $RESOURCEGROUP --vnet-name aro-vnet --name master-subnet --address-prefixes 10.0.0.0/23 --service-endpoints Microsoft.ContainerRegistry 

 Add an empty subnet for the worker nodes. 
 az network vnet subnet create --resource-group $RESOURCEGROUP --vnet-name aro-vnet --name worker-subnet --address-prefixes 10.0.2.0/23 --service-endpoints Microsoft.ContainerRegistry 

 Disable subnet private endpoint policies on the master subnet. This is required to be able to connect and manage the cluster. 

 az network vnet subnet update --name master-subnet --resource-group $RESOURCEGROUP --vnet-name aro-vnet --disable-private-link-service-network-policies true Check accessability

Links:
https://docs.openshift.com/container-platform/4.8/networking/configuring_ingress_cluster_traffic/configuring-ingress-cluster-traffic-ingress-controller.html
https://learn.microsoft.com/en-us/answers/questions/1165736/exposing-aro-cluster-application-on-internet
Related Posts Plugin for WordPress, Blogger...