OpenShift Service Definition: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
m (Ovidiu moved page Service Definition to OpenShift Service Definition without leaving a redirect)
Line 6: Line 6:


* [[OpenShift_Configuration#Definitions|OpenShift Definitions]]
* [[OpenShift_Configuration#Definitions|OpenShift Definitions]]
=Example=
<syntaxhighlight lang=yaml>
apiVersion: v1
kind: Service
metadata:
  annotations:
    description: The Gogs server's http port
  labels:
    app: gogs
  name: gogs
spec:
  ports:
  - name: web
    port: 3000
    protocol: TCP
    targetPort: 3000
  selector:
    app: gogs
    deploymentconfig: gogs
  sessionAffinity: None
  type: ClusterIP
</syntaxhighlight>

Revision as of 19:15, 23 November 2017

External

Internal

Example

 apiVersion: v1
 kind: Service
 metadata:
   annotations:
     description: The Gogs server's http port
   labels:
     app: gogs
   name: gogs
 spec:
   ports:
   - name: web
     port: 3000
     protocol: TCP
     targetPort: 3000
   selector:
     app: gogs
     deploymentconfig: gogs
   sessionAffinity: None
   type: ClusterIP