cancel
Showing results for 
Search instead for 
Did you mean: 
Meera
Cadet
Cadet
  • 1,012 Views

Openshift Application Development

Team

I was trying to inject configuration data into a openshift/hello-world application. Before doing this i had to import image from a external registry url .  created secrets and imported the image.  when i ran the new-app with the image only the deployment configuration and the container pods ran.  The build configuration never was seen with the oc get pods commands.  Without the build config i was unable toe xpose the svc and get the route.  Under what environment will a pod only spin DC/actual container ?

Appreciate if anyone can share their experience

Labels (1)
0 Kudos
1 Reply
flozano
Moderator
Moderator
  • 1,005 Views

oc new-app creates a set of resources to build and run a container image but it knows nothing about secrets, configuration maps, PVCs, and other resources you might have created earlier.

You need to change the deployment resource (or deployment configuration, depending on your OpenShift release) created by oc new-app to use your secrets etc. Check the oc set command as one way of doing that.

Exposing a route has no relationship with the oc new-app command. You just need an svc to expose it, creating a route. oc new-app is just one of the ways of creating an svc from a set of pods managed by a deployment.

Oc new-app might create, depending on its arguments:

1. A build configuration

2. An image stream

3. A deployment (or deployment configuration)

4. A service

You only get a build configuration if the argument to oc new-app points to source code. If you point to a container image in a registry, you get no build configuration but get a deployment and service the same way.

oc new-app does not create pods. The deployment or deployment configuration creates pods.

If you use the oc get pods commands you would not see any build configuration because that command lists only pods. But you can try oc get bc to see build configurations, oc get svc to see services, etc. Maybe you wanna try oc status to see a summary of the main resources in your projects.

 

 

0 Kudos
Join the discussion
You must log in to join this conversation.