OpenShift Service Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 7: Line 7:
Use a template similar to https://github.com/NovaOrdis/playground/blob/master/openshift/templates/eap7-service-template.yaml.
Use a template similar to https://github.com/NovaOrdis/playground/blob/master/openshift/templates/eap7-service-template.yaml.


then
then:


  oc process -p APPLICATION_NAME=my-app-name -p CLUSTER_IP=<''cluster-ip-value''> -f ./novaordis-service-template.yaml | oc create -f -
  oc process -p APPLICATION_NAME=my-app-name -f ./novaordis-service-template.yaml | oc create -f -


The only method to find a valid cluster IP I could think of was to run oc new-app jenkins-ephemeral in the target project and read the cluster IP from the newly created service definition.
<font color=red>DID NOT WORK, got:


<font color=red>DID NOT WORK</font>
</font>


I worked around by using the web UI and


172.30.208.72
<syntaxhighlight lang='yaml'>
apiVersion: v1
kind: Service
metadata:
  annotations:
    openshift.io/generated-by: novaordis-service-template
  labels:
    app: novaordis-session-servlet
    application: novaordis-session-servlet
    template: novaordis-service-template
  name: novaordis-session-servlet
spec:
  ports:
  - port: 8080
    protocol: TCP
    targetPort: 8080
  selector:
    deploymentConfig: novaordis-session-servlet
  sessionAffinity: None
  type: ClusterIP
status:
</syntaxhighlight>

Revision as of 09:51, 7 December 2017

Internal

Create a Service

Use a template similar to https://github.com/NovaOrdis/playground/blob/master/openshift/templates/eap7-service-template.yaml.

then:

oc process -p APPLICATION_NAME=my-app-name -f ./novaordis-service-template.yaml | oc create -f -

DID NOT WORK, got:


I worked around by using the web UI and

apiVersion: v1
kind: Service
metadata:
  annotations:
    openshift.io/generated-by: novaordis-service-template
  labels:
    app: novaordis-session-servlet
    application: novaordis-session-servlet
    template: novaordis-service-template
  name: novaordis-session-servlet
spec:
  ports:
  - port: 8080
    protocol: TCP
    targetPort: 8080
  selector:
    deploymentConfig: novaordis-session-servlet
  sessionAffinity: None
  type: ClusterIP
status: