OC Rollout with specific tag name - openshift

I have created Tag Version using oc tag command in CLI, i have to deploy the image with recently created tag version.
Ex. oc tag <Source Service Name>:latest <Destination Service Name>:Rel10.0.
I have created Tag Name as Rel10.0, i have to select this Tag name and deploy it using CLI.
What is OC Command i have to use?
I have tried with oc rollout latest but this command does only deploy. I have to select that specific tag name and deploy the image.
oc rollout latest <image name>
I know after doing oc tag in CLI, we can check in Openshift UI for that specific tag name select and deploy it. I dont want to use Openshift i want to use CLI and do this job.

oc set image $resourcetype $containername=$imagename:$tag
so assuming you have a deployment named web which has a container named server using nginx image you would do the following:
oc set image deployment web server=nginx:latest

Related

Failed to pull image "image-registry.openshift-image-registry.svc:5000/..." OpenShift CRC

I am trying to install a sample application using the git option in OpenShift 4.7.2 (CodeReady containers 1.24) and I keep getting the below error while openshift tries to build the image to be deployed.
Failed to pull image
"image-registry.openshift-image-registry.svc:5000/employee-ecosys/person-service:latest": rpc error:
code = Unknown
desc = Error reading manifest latest in image-registry.openshift-image-registry.svc:5000/employee-ecosys/person-service:
manifest unknown: manifest unknown
The application person-service is a simple crud application build using spring-boot and uses in-memory h2 as its database. Github repo is here
Some checks to perform:
Are the image registry pods running?
oc get pods -n openshift-image-registry
Is your specific image created?
oc get images | grep "person-service"
Do you get any images?
oc get images
"latest" is kind of a special tag. You should never manually tag an image as "latest". Openshift will consider the "latest" tag to be the newest image, regardless of what tag it has.
I am not familiar with the git deploy method. I have personally very little experience with any s2i builds. I normally use a git repo for the openshift/kubernetes resources and a git repo for the code (they can be the same but separated in the tree by folder structure) and use a pipeline or manually build the image and push it to a registry somewhere and then let openshift pull it from there.

OpenShift use import-image to result into custom image tag

I'm trying to import image from docker repository and tag it with custom tag. Found a command import-image but it results image with tag latest
(example command: oc import-image docker-repo --from=target-image-with-tag --confirm=true)
Is there other oc commands I could use in this case?
The usage for oc import-image is documented as follows:
oc import-image IMAGESTREAM[:TAG] [flags]
As you do not specify a tag for the ImageStream, "latest" is used. So try something like:
oc import-image docker-repo:mytag --from=target-image-with-tag --confirm=true

Can oc new-app create a Deployment instead of a DeploymentConfig?

oc new-app always creates a DeploymentConfig. Is there an option to create a Deployment instead of a DeploymentConfig?
Why? DeploymentConfig is a proprietary legacy Red Hat only resource kind. I would prefer a modern cross platform industry standard Deployment.
oc new-app always creates a DeploymentConfig. Is there an option to create a Deployment instead of a DeploymentConfig?
Current versions of oc have been creating Deployments for quite some time now:
$ oc new-app --docker-image=<IMAGE> --name=my-application
--> Found container image [..]
* An image stream tag will be created as "my-application:latest" that will track this image
--> Creating resources ...
imagestream.image.openshift.io "my-application" created
deployment.apps "my-application" created
service "my-application" created
--> Success
Application is not exposed. You can expose services to the outside world by executing one or more of the commands below:
'oc expose service/my-application'
Run 'oc status' to view your app.
$ oc get deployment
NAME READY UP-TO-DATE AVAILABLE AGE
my-application 1/1 1 1 7s
$ oc get deploymentconfig
No resources found in simon namespace.
So you should update your oc client as you seem to be using an old version (my output above is with a 4.6 client).
The old behaviour of creating a DeploymentConfig can still be forced by using the
--as-deployment-config option:
$ oc new-app --docker-image=<IMAGE> --name=my-application --as-deployment-config
Note that DeploymentConfigs still have their place if you want to use features like triggers, automatic rollback, lifecycle hooks or custom strategies (DeploymentConfigs-specific features)

In OpenShift, Deploy application from web console using image name

I can deploy a new app following command from OpenShift Container Platform Command Line Interface (oc CLI)
//oc new-app --docker-image=<docker-registry-host>:<registry-port>/<image-name:version> --name=customer --insecure-registry=true
$ oc new-app --docker-image=174.24.100.52:8438/spring-customer:v1 --name=customer --insecure-registry=true
It is OK, but I want to deploy from OpenShift web console and then go through AddProject>>deploy image section.
When Firstly I select image name radio button and then typed in the box the following 174.24.100.52:8438/spring-customer:v1
I have an error like this:
Internal error occurred: Get https://172.24.100.50:8448/v2/: Tunnel or
SSL Forbidden
The image may not exist or it may be in a secure registry. Check that
you have entered the image name correctly or create an image pull
secret with your image registry credentials and try again.

Can we add functionality to OpenShift default UI

Can we display the pods from all projects on a single page?
enter code here
AFAIK, you can display pods per project on the GUI (web console, grafana, cluster/application console).
Using CLI is as follows for diplaying all pods from all projects.
# oc get pod --all-namespaces