OpenShift Service Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * OpenShift Operations =Create a Service= Use a template similar to: apiVersion: v1 kind: Template metadata: name: nov...")
 
Line 11: Line 11:
  metadata:
  metadata:
   name: novaordis-service-template
   name: novaordis-service-template
parameters:
- name: APPLICATION_NAME
  value: my-app-name
  required: true
  objects:
  objects:
  - apiVersion: v1
  - apiVersion: v1
Line 16: Line 20:
   metadata:
   metadata:
     annotations:
     annotations:
      description: The web server's http port.
       openshift.io/generated-by: novaordis-service-template
       openshift.io/generated-by: OpenShiftNewApp
     labels:
     labels:
       app: eap70-basic-s2i
       app: ${APPLICATION_NAME}
       application: session-servlet
       application: ${APPLICATION_NAME}
       template: eap70-basic-s2i
       template: novaordis-service-template
      xpaas: 1.4.0
     name: ${APPLICATION_NAME}
     name: session-servlet
   spec:
   spec:
     ports:
     ports:
Line 30: Line 32:
       targetPort: 8080
       targetPort: 8080
     selector:
     selector:
       deploymentConfig: session-servlet
       deploymentConfig: ${APPLICATION_NAME}
     sessionAffinity: None
     sessionAffinity: None
     type: ClusterIP
     type: ClusterIP
   status:
   status:

Revision as of 09:03, 7 December 2017

Internal

Create a Service

Use a template similar to:

apiVersion: v1
kind: Template
metadata:
  name: novaordis-service-template
parameters:
- name: APPLICATION_NAME
  value: my-app-name
  required: true
objects:
- apiVersion: v1
  kind: Service
  metadata:
    annotations:
      openshift.io/generated-by: novaordis-service-template
    labels:
      app: ${APPLICATION_NAME}
      application: ${APPLICATION_NAME}
      template: novaordis-service-template
    name: ${APPLICATION_NAME}
  spec:
    ports:
    - port: 8080
      protocol: TCP
      targetPort: 8080
    selector:
      deploymentConfig: ${APPLICATION_NAME}
    sessionAffinity: None
    type: ClusterIP
  status: