Created
March 21, 2018 13:13
-
-
Save e-minguez/660683b04a5754402e5bb169a9005745 to your computer and use it in GitHub Desktop.
oc create -f && oc new-app --template=pacman
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Template | |
labels: | |
template: pacman | |
metadata: | |
annotations: | |
description: Pacman sample application | |
openshift.io/display-name: Pacman | |
tags: pacman | |
name: pacman | |
objects: | |
- apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: mongo-storage | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: 8Gi | |
- apiVersion: v1 | |
kind: Service | |
metadata: | |
labels: | |
name: mongo | |
name: mongo | |
spec: | |
type: ClusterIP | |
ports: | |
- port: 27017 | |
targetPort: 27017 | |
selector: | |
name: mongo | |
- apiVersion: v1 | |
kind: Service | |
metadata: | |
name: pacman | |
labels: | |
name: pacman | |
spec: | |
type: ClusterIP | |
ports: | |
- port: 80 | |
targetPort: 8080 | |
protocol: TCP | |
selector: | |
name: pacman | |
- apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
labels: | |
name: mongo | |
name: mongo | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
labels: | |
name: mongo | |
spec: | |
containers: | |
- image: mongo | |
name: mongo | |
ports: | |
- name: mongo | |
containerPort: 27017 | |
volumeMounts: | |
- name: mongo-db | |
mountPath: /data/db | |
volumes: | |
- name: mongo-db | |
persistentVolumeClaim: | |
claimName: mongo-storage | |
- apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
labels: | |
name: pacman | |
name: pacman | |
spec: | |
replicas: 2 | |
template: | |
metadata: | |
labels: | |
name: pacman | |
spec: | |
containers: | |
- image: gcr.io/ifontlabs/pacman-nodejs-app:latest | |
name: pacman | |
ports: | |
- containerPort: 8080 | |
name: http-server | |
- apiVersion: v1 | |
id: ${APPLICATION_NAME}-http | |
kind: Route | |
metadata: | |
annotations: | |
description: Route for application's http service. | |
labels: | |
application: ${APPLICATION_NAME} | |
name: ${APPLICATION_NAME} | |
spec: | |
host: ${HOSTNAME_HTTP} | |
to: | |
name: ${APPLICATION_NAME} | |
parameters: | |
- description: The name for the application. | |
displayName: Application Name | |
name: APPLICATION_NAME | |
required: true | |
value: pacman | |
- description: 'Custom hostname for http service route. Leave blank for default hostname, | |
e.g.: <application-name>.<project>.<default-domain-suffix>' | |
displayName: Custom http Route Hostname | |
name: HOSTNAME_HTTP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment