#openshift deploy docker image cli
Explore tagged Tumblr posts
qcs01 · 1 year ago
Text
Deploying Your First Application on OpenShift
Deploying an application on OpenShift can be straightforward with the right guidance. In this tutorial, we'll walk through deploying a simple "Hello World" application on OpenShift. We'll cover creating an OpenShift project, deploying the application, and exposing it to the internet.
Prerequisites
OpenShift CLI (oc): Ensure you have the OpenShift CLI installed. You can download it from the OpenShift CLI Download page.
OpenShift Cluster: You need access to an OpenShift cluster. You can set up a local cluster using Minishift or use an online service like OpenShift Online.
Step 1: Log In to Your OpenShift Cluster
First, log in to your OpenShift cluster using the oc command.
oc login https://<your-cluster-url> --token=<your-token>
Replace <your-cluster-url> with the URL of your OpenShift cluster and <your-token> with your OpenShift token.
Step 2: Create a New Project
Create a new project to deploy your application.
oc new-project hello-world-project
Step 3: Create a Simple Hello World Application
For this tutorial, we'll use a simple Node.js application. Create a new directory for your project and initialize a new Node.js application.
mkdir hello-world-app cd hello-world-app npm init -y
Create a file named server.js and add the following content:
const express = require('express'); const app = express(); const port = 8080; app.get('/', (req, res) => res.send('Hello World from OpenShift!')); app.listen(port, () => { console.log(`Server running at http://localhost:${port}/`); });
Install the necessary dependencies.
npm install express
Step 4: Create a Dockerfile
Create a Dockerfile in the same directory with the following content:
FROM node:14 WORKDIR /app COPY package*.json ./ RUN npm install COPY . . EXPOSE 8080 CMD ["node", "server.js"]
Step 5: Build and Push the Docker Image
Log in to your Docker registry (e.g., Docker Hub) and push the Docker image.
docker login docker build -t <your-dockerhub-username>/hello-world-app . docker push <your-dockerhub-username>/hello-world-app
Replace <your-dockerhub-username> with your Docker Hub username.
Step 6: Deploy the Application on OpenShift
Create a new application in your OpenShift project using the Docker image.
oc new-app <your-dockerhub-username>/hello-world-app
OpenShift will automatically create the necessary deployment configuration, service, and pod for your application.
Step 7: Expose the Application
Expose your application to create a route, making it accessible from the internet.
oc expose svc/hello-world-app
Step 8: Access the Application
Get the route URL for your application.
oc get routes
Open the URL in your web browser. You should see the message "Hello World from OpenShift!".
Conclusion
Congratulations! You've successfully deployed a simple "Hello World" application on OpenShift. This tutorial covered the basic steps, from setting up your project and application to exposing it on the internet. OpenShift offers many more features for managing applications, so feel free to explore its documentation for more advanced topic
For more details click www.qcsdclabs.com 
0 notes
codecraftshop · 5 years ago
Text
Deploy application in openshift using container images
Deploy application in openshift using container images
#openshift #containerimages #openshift # openshift4 #containerization
Deploy container app using OpenShift Container Platform running on-premises,openshift deploy docker image cli,openshift deploy docker image command line,how to deploy docker image in openshift,how to deploy image in openshift,deploy image in openshift,deploy…
View On WordPress
0 notes
venatrix191-blog · 6 years ago
Text
Use the power of kubernetes with Openshift Origin
Get the most modern and powerful Openshift OKD subscription with VENATRIX.
OpenShift Origin / OKD is an open source cloud development Platform as a Service (PaaS). This cloud-based platform allows developers to create, test and run their applications and deploy them to the cloud.
Automate the Build, Deployment and Management of your Applications with openshift Origin Platform.
OpenShift is suitable for any application, language, infrastructure, and industry. Using OpenShift helps developers to use their resources more efficiently and flexible, improve monitoring and maintenance, harden the applications security and overall make the developer experience a lot better. Venatrix’s OpenShift Services are infrastructure independent and therefore any industry can benefit from it.
What is openshift Origin?
Red Hat OpenShift Origin is a multifaceted, open source container application platform from Red Hat Inc. for the development, deployment and management of applications. OpenShift Origin Best vps hosting container Platform can deploy on a public, private or hybrid cloud that helps to deploy the applications with the use of Docker containers. It is built on top of Kubernetes and gives you tools like a web console and CLI to manage features like load balancing and horizontal scaling. It simplifies operations and development for cloud native applications.
Red Hat OpenShift Origin Container Platform helps the organization develop, deploy, and manage existing and container-based apps seamlessly across physical, virtual, and public cloud infrastructures. Its built on proven open source technologies and helps application development and IT operations teams modernize applications, deliver new services, and accelerate development processes.
Developers can quickly and easily create applications and deploy them. With S2I (Source-to-Image), a developer can even deploy his code without needing to create a container first. Operators can leverage placement and policy to orchestrate environments that meet their best practices. It makes the development and operations work fluently together when combining them in a single platform. It deploys Docker containers, it gives the ability to run multiple languages, frameworks and databases on the same platform. Easily deploy microservices written in Java, Python, PHP or other languages.
1 note · View note
computingpostcom · 3 years ago
Text
I now have Harbor image registry configured.. How can I pull images from Harbor registry on Kubernetes / OpenShift with a pull secret?. Harbor is a CNCF certified project which aids in storage of OCI images and Helm charts. As Harbor provides authentication system and RBAC, you’ll likely have to add a pull secret for a user or robot account in your Kubernetes or OpenShift Cluster. Step 1: Login to Harbor on Workstation with docker / podman Start by logging in to your Harbor registry from Docker CLI or Podman CLI. If your registry is on a custom port, e.g 5000, then your URL will be like myregistry.example.com:5000. If your Harbor registry is not secure. Add it to the list of insecure registries. --- Podman --- $ sudo vim /etc/containers/registries.conf ... [registries.insecure] registries = ['myregistry.example.com'] --- Docker --- $ sudo vim /etc/docker/daemon.json "insecure-registries" : ["myregistry.example.com"] $ sudo systemctl restart docker $ docker info Docker Login: $ docker login myregistry.example.com Username: jkmutai Password: Login Succeeded! Podman Login: $ docker login myregistry.example.com Username: jkmutai Password: Login Succeeded! Docker will store your registry access information under ~/.docker/config.json. $ cat ~/.docker/config.json While Podman stores then under /run/user/UserID/containers/auth.json $ cat /run/user/`id -u`/containers/auth.json You may need to copy the access credentials in json format to the server with kubectl or oc command. Step 2: Add Harbor registry Secret to Kubernetes / OpenShift Next we need to add the access details for Harbor registry as secret in Kubernetes/OpenShift. kubectl create secret generic harbor-registry-secret \ --from-file=.dockerconfigjson=./harbor-k8s.json \ --type=kubernetes.io/dockerconfigjson \ -n demo Where: ./harbor-k8s.json is the path to your Docker/Podman json file. Change it accordingly. demo is the name of the namespace where the secret is to be created Confirm secret creation: $ oc get secrets harbor-registry-secret NAME TYPE DATA AGE harbor-registry-secret kubernetes.io/dockerconfigjson 1 30s If you ever want to decrypt added secret to confirm values, you can use the command: kubectl get secret harbor-registry-secret \ --output="jsonpath=.data.\.dockerconfigjson" | base64 --decode Step 3: Confirm you can deploy Application from image in Harbor registry Upload an image to Harbor registry – You’ll need to first create a project in harbor. $ podman pull docker.io/jmutai/kuard-amd64:blue $ podman tag docker.io/jmutai/kuard-amd64:blue myregistry.example.com/myproject/kuard-amd64:blue $ docker push myregistry.example.com/myproject/kuard-amd64:blue Getting image source signatures Copying blob bcf2f368fe23 done Copying blob 656e9c47289e done Copying config 1db936caa6 done Writing manifest to image destination Storing signatures Where: myregistry.example.com is harbor registry URL myproject is the project the added user has access to Create a Pod deployment manifest for Kubernetes. $ vim kuard-pod-health.yaml --- apiVersion: v1 kind: Pod metadata: name: kuard spec: imagePullSecrets: - name: harbor-registry-secret containers: - name: kuard image: myregistry.example.com/myproject/kuard-amd64:blue ports: - containerPort: 8080 name: http protocol: TCP resources: requests: cpu: "500m" memory: "128Mi" limits: cpu: "500m" memory: "256Mi" Create a Pod. $ kubectl apply -f kuard-pod-health.yaml -n pod/kuard created Confirm deployment was successful. $ kubectl get pod -n NAME READY STATUS RESTARTS AGE kuard 1/1 Running 0 2m18s If the pod is not created, check events to understand why. $ kubectl
0 notes
qcs01 · 1 year ago
Text
Deploying a Containerized Application with Red Hat OpenShift
Introduction
In this post, we'll walk through the process of deploying a containerized application using Red Hat OpenShift, a powerful Kubernetes-based platform for managing containerized workloads.
What is Red Hat OpenShift?
Red Hat OpenShift is an enterprise Kubernetes platform that provides developers with a full set of tools to build, deploy, and manage applications. It integrates DevOps automation tools to streamline the development lifecycle.
Prerequisites
Before we begin, ensure you have the following:
A Red Hat OpenShift cluster
Access to the OpenShift command-line interface (CLI)
A containerized application (Docker image)
Step 1: Setting Up Your OpenShift Environment
First, log in to your OpenShift cluster using the CLI:
oc login https://your-openshift-cluster:6443
Step 2: Creating a New Project
Create a new project for your application:
oc new-project my-app
Step 3: Deploying Your Application
Deploy your Docker image using the oc new-app command:
oc new-app my-docker-image
Step 4: Exposing Your Application
Expose your application to create a route and make it accessible:
oc expose svc/my-app
Use Cases
OpenShift is ideal for deploying microservices architectures, CI/CD pipelines, and scalable web applications. Here are a few scenarios where OpenShift excels.
Best Practices
Use health checks to ensure your applications are running smoothly.
Implement resource quotas to prevent any single application from consuming too many resources.
Performance and Scalability
To optimize performance, consider using horizontal pod autoscaling. This allows OpenShift to automatically adjust the number of pods based on CPU or memory usage.
Security Considerations
Ensure your images are scanned for vulnerabilities before deployment. OpenShift provides built-in tools for image scanning and compliance checks.
Troubleshooting
If you encounter issues, check the logs of your pods:
oc logs pod-name
Conclusion
Deploying applications with Red Hat OpenShift is straightforward and powerful. By following best practices and utilizing the platform's features, you can ensure your applications are scalable, secure, and performant.
0 notes
codecraftshop · 5 years ago
Video
youtube
Deploy application in openshift using container images#openshift #containerimages #openshift # openshift4 #containerization Deploy container app using OpenShift Container Platform running on-premises,openshift deploy docker image cli,openshift deploy docker image command line,how to deploy docker image in openshift,how to deploy image in openshift,deploy image in openshift,deploy image into openshift,Deploy application in openshift using container images,openshift container platform,openshift tutorial,red hat openshift,openshift,kubernetes,openshift 4,red hat,redhat openshift online https://www.youtube.com/channel/UCnIp4tLcBJ0XbtKbE2ITrwA?sub_confirmation=1&app=desktop About: 00:00 Deploy application in openshift using container images In this course we will learn about deploying an application from container images to openshift / openshift 4 online cluster in different ways. First method is to use the webconsole to deploy application using docker container images. Second way is to login through OC openshift cluster command line tool for windows and through oc command we can deploy the container image to openshift cluster. Openshift/ Openshift4 a cloud based container to build deploy test our application on cloud. In the next videos we will explore Openshift4 in detail. Commands Used: Image to be deployed: openshiftkatacoda/blog-django-py oc get all -o name :-This will return all the resources we have in the project oc describe route/blog-django-py :-This will give us the details of the route that has been created. Through this route or url we can access the application externally. oc get all --selector app=blog-django-py -o name :-This will select only the resources with the label app=blog-django-py . By default openshift automatically applies the label app=blog-django-py to all the resources of the application. oc delete all --selector app=blog-django-py :-This will delete the application and the related resources having label app= app=blog-django-py oc get all -o name :-This get the list of all the available resources. oc new-app --search openshiftkatacoda/blog-django-py oc new-app openshiftkatacoda/blog-django-py :-This command will create / deploy the image in openshift container. oc new-app openshiftkatacoda/blog-django-py -o name blog :-This command will create / deploy the image in openshift container with custom name oc expose service/blog-django-py :-This will expose the service to the external world so that it can be accessed globally. oc get route/blog-django-py --- this will give the url of the application that we have deployed. certification,OpenShift workflow,openshift tutorial,ci cd pipeline,ci cd devops,openshift container platform,ci cd openshift,openshift installation,Getting Started with OpenShift,OpenShift for the Absolute Beginners,Get started with RedHat OpenShift https://www.facebook.com/codecraftshop/ https://t.me/codecraftshop/ Please do like and subscribe to my you tube channel "CODECRAFTSHOP" Follow us on facebook | instagram | twitter at @CODECRAFTSHOP . -~-~~-~~~-~~-~- Please watch: "Install hyperv on windows 10 - how to install, setup & enable hyper v on windows hyper-v" https://www.youtube.com/watch?v=KooTCqf07wk -~-~~-~~~-~~-~-
0 notes
codecraftshop · 5 years ago
Video
youtube
Deploy application in openshift using container imagesOpenshift 4 is latest devops technology which can benefit the enterprise in a lot of ways. Build development and deployment can be automated using Openshift 4 platform. Features for autoscaling , microservices architecture and lot more features. So please like watch subscribe my channel for the latest videos. #Deploy #application #openshift #container #images #openshift # openshift4 #containerization #cloud #online #container #kubernetes #docker #automation #redhatopenshift #openshifttutorial #openshiftonline, Deploy container app using OpenShift Container Platform running on-premises,how to deploy node js application in openshift,openshift deploy docker image cli,openshift deploy docker image command line,how to deploy docker image in openshift,how to deploy image in openshift,deploy image in openshift,deploy image into openshift,Deploy application in openshift using container images,openshift container platform,openshift tutorial,red hat openshift,openshift,kubernetes https://www.youtube.com/channel/UCnIp4tLcBJ0XbtKbE2ITrwA?sub_confirmation=1&app=desktop About: 00:00 Deploy application in openshift using container images In this course we will learn about deploying an application from container images to openshift / openshift 4 online cluster in different ways. First method is to use the webconsole to deploy application using docker container images. Second way is to login through OC openshift cluster command line tool for windows and through oc command we can deploy the container image to openshift cluster. Openshift/ Openshift4 a cloud based container to build deploy test our application on cloud. In the next videos we will explore Openshift4 in detail. Commands Used: Image to be deployed: openshiftkatacoda/blog-django-py oc get all -o name :-This will return all the resources we have in the project oc describe route/blog-django-py :-This will give us the details of the route that has been created. Through this route or url we can access the application externally. oc get all --selector app=blog-django-py -o name :-This will select only the resources with the label app=blog-django-py . By default openshift automatically applies the label app=blog-django-py to all the resources of the application. oc delete all --selector app=blog-django-py :-This will delete the application and the related resources having label app= app=blog-django-py oc get all -o name :-This get the list of all the available resources. oc new-app --search openshiftkatacoda/blog-django-py oc new-app openshiftkatacoda/blog-django-py :-This command will create / deploy the image in openshift container. oc new-app openshiftkatacoda/blog-django-py -o name blog :-This command will create / deploy the image in openshift container with custom name oc expose service/blog-django-py :-This will expose the service to the external world so that it can be accessed globally. oc get route/blog-django-py --- this will give the url of the application that we have deployed. certification,OpenShift workflow,openshift tutorial,ci cd pipeline,ci cd devops,openshift container platform,ci cd openshift,openshift installation,Getting Started with OpenShift,OpenShift for the Absolute Beginners,Get started with RedHat OpenShift https://www.facebook.com/codecraftshop/ https://t.me/codecraftshop/ Please do like and subscribe to my you tube channel "CODECRAFTSHOP" Follow us on facebook | instagram | twitter at @CODECRAFTSHOP . -~-~~-~~~-~~-~- Please watch: "Install hyperv on windows 10 - how to install, setup & enable hyper v on windows hyper-v" https://www.youtube.com/watch?v=KooTCqf07wk -~-~~-~~~-~~-~-
0 notes
codecraftshop · 5 years ago
Video
youtube
Deploy application in openshift using container imagesOpenshift 4 is latest devops technology which can benefit the enterprise in a lot of ways. Build development and deployment can be automated using Openshift 4 platform. Features for autoscaling , microservices architecture and lot more features. So please like watch subscribe my channel for the latest videos. #Deploy #application #openshift #container #images #openshift # openshift4 #containerization #cloud #online #container #kubernetes #docker #automation #redhatopenshift #openshifttutorial #openshiftonline, Deploy container app using OpenShift Container Platform running on-premises,how to deploy node js application in openshift,openshift deploy docker image cli,openshift deploy docker image command line,how to deploy docker image in openshift,how to deploy image in openshift,deploy image in openshift,deploy image into openshift,Deploy application in openshift using container images,openshift container platform,openshift tutorial,red hat openshift,openshift,kubernetes https://www.youtube.com/channel/UCnIp4tLcBJ0XbtKbE2ITrwA?sub_confirmation=1&app=desktop About: 00:00 Deploy application in openshift using container images In this course we will learn about deploying an application from container images to openshift / openshift 4 online cluster in different ways. First method is to use the webconsole to deploy application using docker container images. Second way is to login through OC openshift cluster command line tool for windows and through oc command we can deploy the container image to openshift cluster. Openshift/ Openshift4 a cloud based container to build deploy test our application on cloud. In the next videos we will explore Openshift4 in detail. Commands Used: Image to be deployed: openshiftkatacoda/blog-django-py oc get all -o name :-This will return all the resources we have in the project oc describe route/blog-django-py :-This will give us the details of the route that has been created. Through this route or url we can access the application externally. oc get all --selector app=blog-django-py -o name :-This will select only the resources with the label app=blog-django-py . By default openshift automatically applies the label app=blog-django-py to all the resources of the application. oc delete all --selector app=blog-django-py :-This will delete the application and the related resources having label app= app=blog-django-py oc get all -o name :-This get the list of all the available resources. oc new-app --search openshiftkatacoda/blog-django-py oc new-app openshiftkatacoda/blog-django-py :-This command will create / deploy the image in openshift container. oc new-app openshiftkatacoda/blog-django-py -o name blog :-This command will create / deploy the image in openshift container with custom name oc expose service/blog-django-py :-This will expose the service to the external world so that it can be accessed globally. oc get route/blog-django-py --- this will give the url of the application that we have deployed. certification,OpenShift workflow,openshift tutorial,ci cd pipeline,ci cd devops,openshift container platform,ci cd openshift,openshift installation,Getting Started with OpenShift,OpenShift for the Absolute Beginners,Get started with RedHat OpenShift https://www.facebook.com/codecraftshop/ https://t.me/codecraftshop/ Please do like and subscribe to my you tube channel "CODECRAFTSHOP" Follow us on facebook | instagram | twitter at @CODECRAFTSHOP . -~-~~-~~~-~~-~- Please watch: "Install hyperv on windows 10 - how to install, setup & enable hyper v on windows hyper-v" https://www.youtube.com/watch?v=KooTCqf07wk -~-~~-~~~-~~-~-
0 notes
codecraftshop · 5 years ago
Video
youtube
Deploy application in openshift using container imagesOpenshift 4 is latest devops technology which can benefit the enterprise in a lot of ways. Build development and deployment can be automated using Openshift 4 platform. Features for autoscaling , microservices architecture and lot more features. So please like watch subscribe my channel for the latest videos. #Deploy #application #openshift #container #images #openshift # openshift4 #containerization #cloud #online #container #kubernetes #docker #automation #redhatopenshift #openshifttutorial #openshiftonline, Deploy container app using OpenShift Container Platform running on-premises,how to deploy node js application in openshift,openshift deploy docker image cli,openshift deploy docker image command line,how to deploy docker image in openshift,how to deploy image in openshift,deploy image in openshift,deploy image into openshift,Deploy application in openshift using container images,openshift container platform,openshift tutorial,red hat openshift,openshift,kubernetes https://www.youtube.com/channel/UCnIp4tLcBJ0XbtKbE2ITrwA?sub_confirmation=1&app=desktop About: 00:00 Deploy application in openshift using container images In this course we will learn about deploying an application from container images to openshift / openshift 4 online cluster in different ways. First method is to use the webconsole to deploy application using docker container images. Second way is to login through OC openshift cluster command line tool for windows and through oc command we can deploy the container image to openshift cluster. Openshift/ Openshift4 a cloud based container to build deploy test our application on cloud. In the next videos we will explore Openshift4 in detail. Commands Used: Image to be deployed: openshiftkatacoda/blog-django-py oc get all -o name :-This will return all the resources we have in the project oc describe route/blog-django-py :-This will give us the details of the route that has been created. Through this route or url we can access the application externally. oc get all --selector app=blog-django-py -o name :-This will select only the resources with the label app=blog-django-py . By default openshift automatically applies the label app=blog-django-py to all the resources of the application. oc delete all --selector app=blog-django-py :-This will delete the application and the related resources having label app= app=blog-django-py oc get all -o name :-This get the list of all the available resources. oc new-app --search openshiftkatacoda/blog-django-py oc new-app openshiftkatacoda/blog-django-py :-This command will create / deploy the image in openshift container. oc new-app openshiftkatacoda/blog-django-py -o name blog :-This command will create / deploy the image in openshift container with custom name oc expose service/blog-django-py :-This will expose the service to the external world so that it can be accessed globally. oc get route/blog-django-py --- this will give the url of the application that we have deployed. certification,OpenShift workflow,openshift tutorial,ci cd pipeline,ci cd devops,openshift container platform,ci cd openshift,openshift installation,Getting Started with OpenShift,OpenShift for the Absolute Beginners,Get started with RedHat OpenShift https://www.facebook.com/codecraftshop/ https://t.me/codecraftshop/ Please do like and subscribe to my you tube channel "CODECRAFTSHOP" Follow us on facebook | instagram | twitter at @CODECRAFTSHOP . -~-~~-~~~-~~-~- Please watch: "Install hyperv on windows 10 - how to install, setup & enable hyper v on windows hyper-v" https://www.youtube.com/watch?v=KooTCqf07wk -~-~~-~~~-~~-~-
0 notes
venatrix191-blog · 6 years ago
Text
Best vps hosting in india
Get the most modern and powerful Openshift OKD subscription with VENATRIX.
OpenShift Origin / OKD is an open source cloud development Platform as a Service (PaaS). This cloud-based platform allows developers to create, test and run their applications and deploy them to the cloud.
Automate the Build, Deployment and Management of your Applications with openshift Origin Platform.
OpenShift Best vps hosting in india  is suitable for any application, language, infrastructure, and industry. Using OpenShift helps developers to use their resources more efficiently and flexible, improve monitoring and maintenance, harden the applications security and overall make the developer experience a lot better. Venatrix’s OpenShift Services are infrastructure independent and therefore any industry can benefit from it.
What is openshift Origin?
Red Hat OpenShift Origin is a multifaceted, open source container application platform from Red Hat Inc. for the development, deployment and management of applications. OpenShift Origin container Platform can deploy on a public, private or hybrid cloud that helps to deploy the applications with the use of Docker containers. It is built on top of Kubernetes and gives you tools like a web console and CLI to manage features like load balancing and horizontal scaling. It simplifies operations and development for cloud native applications.
Red Hat OpenShift Origin Container Platform helps the organization develop, deploy, and manage existing and container-based apps seamlessly across physical, virtual, and public cloud infrastructures. Its built on proven open source technologies and helps application development and IT operations teams modernize applications, deliver new services, and accelerate development processes.
Developers can quickly and easily create applications and deploy them. With S2I (Source-to-Image), a developer can even deploy his code without needing to create a container first. Operators can leverage placement and policy to orchestrate environments that meet their best practices. It makes the development and operations work fluently together when combining them in a single platform. It deploys Docker containers, it gives the ability to run multiple languages, frameworks and databases on the same platform. Easily deploy microservices written in Java, Python, PHP or other languages.
0 notes