OpenShift Service Operations
Jump to navigation
Jump to search
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:
The template is available as
then
oc process -p APPLICATION_NAME=my-app-name -f ./novaordis-service-template.yaml | oc create -f -