kind: Template apiVersion: v1 metadata: name: startx-php-deploy-template annotations: openshift.io/display-name: Startx PHP Server (ephemeral deploy workflow) description: Deployement workflow of a dynamic PHP web application using ephemeral storage for logs records. Use apache with various underlying linux distribution. See https://hub.docker.com/r/startx/sv-php iconClass: icon-php tags: startx,os,fedora,php,httpd openshift.io/provider-display-name: STARTX openshift.io/documentation-url: https://hub.docker.com/r/startx/sv-php openshift.io/support-url: https://gitlab.com/startx1/containers/issues/new message: |- Your application ${APP_NAME} will be soon deployed. Monitor the deployement for application availability and Follow created route to browse running application Application : ${APP_NAME} Stage : ${APP_STAGE} labels: template: startx-php-deploy-template provider: startx objects: - kind: ImageStream apiVersion: v1 metadata: name: "${APP_NAME}" annotations: openshift.io/display-name: Dynamic application ${APP_NAME} openshift.io/generated-by: STARTX labels: app: "${APP_NAME}" stage: "${APP_STAGE}" spec: tags: - name: ${APP_STAGE} annotations: openshift.io/display-name: Application ${APP_NAME} version ${APP_STAGE} description: ${APP_STAGE} image for the application ${APP_NAME} based on ${BUILDER_TAG} iconClass: icon-php tags: startx,fedora,php,httpd,application,${APP_NAME},${APP_STAGE},${BUILDER_TAG} supports: http version: ${APP_STAGE} from: kind: DockerImage name: startx/sv-php:${BUILDER_TAG} - kind: ConfigMap apiVersion: v1 metadata: name: "${APP_NAME}-config" annotations: openshift.io/display-name: Application ${APP_NAME} configuration openshift.io/generated-by: STARTX labels: app: "${APP_NAME}" stage: "${APP_STAGE}" data: SX_ID: ${APP_NAME}/${APP_STAGE} SX_TYPE: ${APP_STAGE} SX_SERVICE: ${APP_NAME} SX_NAME: Static web application ${APP_NAME} SX_SUMMARY: Static web application ${APP_NAME} based on fedora container SX_VERSION: 0.0.1 - kind: DeploymentConfig apiVersion: v1 metadata: name: "${APP_NAME}" labels: app: "${APP_NAME}" stage: "${APP_STAGE}" annotations: openshift.io/generated-by: STARTX spec: strategy: type: Rolling rollingParams: updatePeriodSeconds: 1 intervalSeconds: 1 timeoutSeconds: 50 maxUnavailable: 25% maxSurge: 25% triggers: - type: ImageChange imageChangeParams: automatic: true containerNames: - "${APP_NAME}" from: kind: ImageStreamTag name: "${APP_NAME}:${APP_STAGE}" - type: ConfigChange postCommit: script: "/bin/sx-php info" replicas: 1 test: false selector: app: "${APP_NAME}" deploymentconfig: "${APP_NAME}" template: metadata: labels: app: "${APP_NAME}" deploymentconfig: "${APP_NAME}" annotations: openshift.io/generated-by: STARTX spec: containers: - name: "${APP_NAME}" image: " " env: - name: SX_VERBOSE value: "true" envFrom: - configMapRef: name: ${APP_NAME}-config command: - "/bin/sx-php" args: - run ports: - containerPort: 8080 protocol: TCP livenessProbe: exec: command: - "/bin/sx-php" - isLive initialDelaySeconds: 4 timeoutSeconds: 2 periodSeconds: 10 successThreshold: 1 failureThreshold: 2 readinessProbe: exec: command: - "/bin/sx-php" - isReady initialDelaySeconds: 4 timeoutSeconds: 2 periodSeconds: 10 successThreshold: 1 failureThreshold: 2 resources: limits: cpu: 8000m memory: 512Mi requests: cpu: 200m memory: 128Mi terminationMessagePath: "/dev/termination-log" imagePullPolicy: Always volumeMounts: - name: "${APP_NAME}-log" mountPath: "/var/log/httpd" volumes: - name: "${APP_NAME}-log" emptyDir: medium: "" restartPolicy: Always terminationGracePeriodSeconds: 30 securityContext: {} dnsPolicy: ClusterFirst - kind: Service apiVersion: v1 metadata: name: "${APP_NAME}" labels: app: "${APP_NAME}" stage: "${APP_STAGE}" annotations: openshift.io/generated-by: STARTX spec: ports: - protocol: TCP port: 8080 targetPort: 8080 selector: app: "${APP_NAME}" deploymentconfig: "${APP_NAME}" type: ClusterIP sessionAffinity: None - kind: Route apiVersion: v1 metadata: name: "${APP_NAME}" labels: app: "${APP_NAME}" stage: "${APP_STAGE}" annotations: openshift.io/generated-by: STARTX spec: to: kind: Service name: "${APP_NAME}" weight: 100 parameters: - name: APP_NAME displayName: Application name description: The name of the created application value: php required: true - name: APP_STAGE displayName: Application stage description: "Stage of the application deployed (ex: dev, test, prod, example, demo, poc, ...)" value: example required: true - name: BUILDER_TAG displayName: Startx image release description: "Image tag of the startx php image used. Could be : latest, fc34, fc33, fc32, fc31, fc30, fc29, fc28, alpine3, ubi8, centos8, centos7, centos6, alma8, rocky8" value: latest required: true - name: MEMORY_LIMIT displayName: Memory Limit description: Maximum amount of memory the container can use. value: 512Mi required: true