Guest User

Untitled

a guest
Jan 6th, 2016
53
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ---
  2. apiVersion: v1
  3. kind: Template
  4. metadata:
  5.   name: sample-phpinfo
  6.   annotations:
  7.     description: Sample PHPinfo APP
  8.     iconClass: icon-web
  9.     tags: "phpinfo,php,nginx,fpm"
  10. objects:
  11.   - kind: Route
  12.     apiVersion: v1
  13.     metadata:
  14.       name: "sample-phpinfo-${SERVICE_NAME}"
  15.     spec:
  16.       host: "${PUBLIC_DOMAIN}"
  17.       to:
  18.         kind: Service
  19.         name: "nginx-${SERVICE_NAME}"
  20.   - kind: Service
  21.     apiVersion: v1
  22.     metadata:
  23.       name: "nginx-${SERVICE_NAME}"
  24.     spec:
  25.       ports:
  26.         - name: http
  27.           protocol: TCP
  28.           port: 80
  29.           targetPort: 80
  30.           nodePort: 0
  31.       selector:
  32.         name: "nginx-${SERVICE_NAME}"
  33.       portalIP: ''
  34.       type: 'ClusterIP'
  35.       sessionAffinity: None
  36.     status:
  37.       loadBalancer: {}
  38.   - kind: Service
  39.     apiVersion: v1
  40.     metadata:
  41.       name: "phpfpm-${SERVICE_NAME}"
  42.     spec:
  43.       ports:
  44.         - name: phpfpm
  45.           protocol: TCP
  46.           port: 9000
  47.           targetPort: 9000
  48.           nodePort: 0
  49.       selector:
  50.         name: "phpfpm-${SERVICE_NAME}"
  51.       portalIP: ''
  52.       type: 'ClusterIP'
  53.       sessionAffinity: None
  54.     status:
  55.       loadBalancer: {}
  56.   - kind: DeploymentConfig
  57.     apiVersion: v1
  58.     metadata:
  59.       name: "nginx-${SERVICE_NAME}"
  60.       annotations:
  61.         description: 'Defines how to deploy nginx front stack'
  62.     spec:
  63.       strategy:
  64.         type: Rolling
  65.       replicas: 1
  66.       selector:
  67.         name: "nginx-${SERVICE_NAME}"
  68.       template:
  69.         metadata:
  70.           name: "nginx-${SERVICE_NAME}"
  71.           labels:
  72.             name: "nginx-${SERVICE_NAME}"
  73.         spec:
  74.           volumes: []
  75.           containers:
  76.             - name: "nginx-${SERVICE_NAME}"
  77.               imagePullPolicy: 'Always'
  78.               image: "docker.io/fvillain/nginx-phpfpm-proxy"
  79.               ports:
  80.                 - containerPort: 80
  81.               env:
  82.                 - name: 'FORWARD_TO'
  83.                   value: 'phpfpm-${SERVICE_NAME}'
  84.                 - name: 'FORWARD_PORT'
  85.                   value: '9000'
  86.   - kind: DeploymentConfig
  87.     apiVersion: v1
  88.     metadata:
  89.       name: "phpfpm-${SERVICE_NAME}"
  90.       annotations:
  91.         description: How to deploy the PHP App
  92.     spec:
  93.       strategy:
  94.         type: Rolling
  95.       replicas: 1
  96.       selector:
  97.         name: "phpfpm-${SERVICE_NAME}"
  98.       template:
  99.         metadata:
  100.           name: "phpfpm-${SERVICE_NAME}"
  101.           labels:
  102.             name: "phpfpm-${SERVICE_NAME}"
  103.         spec:
  104.           volumes: []
  105.           containers:
  106.             - name: "phpfpm-${SERVICE_NAME}"
  107.               imagePullPolicy: 'Always'
  108.               image: "test/sample-phpinfo:latest"
  109.               ports:
  110.                 - containerPort: 9000
  111.               env: []
  112.               readinessProbe:
  113.                 timeoutSeconds: 1
  114.                 initialDelaySeconds: 5
  115.                 tcpSocket:
  116.                   port: 9000
  117.               livenessProbe:
  118.                 timeoutSeconds: 1
  119.                 initialDelaySeconds: 5
  120.                 tcpSocket:
  121.                   port: 9000
  122. parameters:
  123.   - name: PUBLIC_DOMAIN
  124.     description: Public DNS to access the service
  125.     value: ""
  126.     required: false
  127.   - name: SERVICE_NAME
  128.     description: Nginx service name
  129.     from: "phpinfo-app-[0-9]{1}"
  130.     generate: expression
  131.     required: true
  132. labels:
  133.   template: sample-phpinfo
RAW Paste Data