a typical Nginx service file and a Nginx route yaml for Use in Open SHift - unix1998/technical_notes GitHub Wiki
- service YAML ###################
name: nginx-service
spec:
selector: app: nginx # Matches pods with label "app: nginx" ports: - protocol: TCP port: 80 # Service listens on port 80 targetPort: 80 # Forwards traffic to pods' port 80 (default for Nginx) type: ClusterIP # Internal cluster access by default
- end of Service Yaml ##############
- route YAML file##############################
name: nginx-route
spec:
wildcardPolicy: None # No subdomain support host: my-nginx-app.example.com # External hostname port: 80 # Route listens on port 80 (optional) to: kind: Service name: nginx-service # Points to your internal service
- end of Route yaml####