[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: OpenShiftV3 CLI: oc get - command

I use something like this for a similar thing:

oc get svc $serviceName -o template -t='{{.spec.portalIP}}:{{(index .spec.ports 0).port}}'


On 30. 10. 2015 13:21, Lorenz Vanthillo wrote:
I've Jenkins running in a pod, and I want to build + deploy an application (also on OpenShift, with jenkins).
It's working fine. Except the last part. There I want to check if it's possible to curl to my cluster_ip(ofservice):port to see if the app is available:

$SERVICE_IP=oc get service

echo "Checking for successful test deployment at $HOSTNAME"
set +e
while [ $rc -ne 0 -a $count -lt $attempts ]; do
  if curl -s --connect-timeout 2 $SERVICE_IP:$PORT >& /dev/null; then

As you can see, the code is not finished. I'm working with environment variables and I need to get the cluster ip and the port of my service:
oc get service test
NAME      CLUSTER_IP      EXTERNAL_IP   PORT(S)    SELECTOR                         AGE
test   <none>        8080/TCP   app=test,deploymentconfig=test   20h

I can get my service, but is it possible to filter the CLUSTER_IP or PORT with an oc-command?


users mailing list
users lists openshift redhat com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]