martedì 16 luglio 2024

How to deploy Podman images to OpenShift Container Platform (CRC on localhost)

I have a microservice on localhost and I want to deploy its Podman image on OCP, which I am running using CRC on localhost.

     


1.
Get the image registry of ocp:

oc registry info

or

oc get route default-route -n openshift-image-registry

2.Create a is.yaml file

oc create -f is.yaml 

3.Tag podman image:

podman tag image_name `oc registry info`/project_name/image_name:latest

4.Authenticate podman

podman login `oc registry info` -u kubeadmin -p `oc whoami -t` --tls-verify=false

5.Push Podman image

podman push image_id `oc registry info`/project_name/image_name:latest --tls-verify=false

6.Create new app on OpenShift


oc new-app --docker-image=`oc registry info`/project_name/image_name:latest --name=new_app_name -l app=
new_app_name

 


lunedì 3 giugno 2024

Apache Camel global exception handler

@Component
public class SchedRouteBuilder extends RouteBuilder {

@Override
public void configure() throws Exception {
// Define a global exception handler
onException(Exception.class)
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
Exception exception = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class);
exception.printStackTrace();
}
})
.handled(true);

from("direct:message-producer")
.to("paho-mqtt5:{{topicname}}?brokerUrl=tcp://{{brokeraddress}}:{{brokerport}}");
}

}

giovedì 4 aprile 2024

Run minikube with podman on Fedora

After install minikube as described in the documentation, set rootless property to true to use Podman without sudo:


minikube config set rootless true


then start minikube with podman driver:


minikube start --driver=podman --container-runtime=containerd




minikube kubectl cluster-info

How to deploy Podman images to OpenShift Container Platform (CRC on localhost)

I have a microservice on localhost and I want to deploy its Podman image on OCP, which I am running using CRC on localhost.       1. Get the...