Created
February 15, 2019 17:33
-
-
Save Lasherbr/350388a2cb1d80475884f96ec1ed3171 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| message: |- | |
| The following service(s) have been created in your project: ${DATABASE_SERVICE_NAME}. | |
| SEI: | |
| Username: ${MYSQL_USER_SEI} | |
| Password: ${MYSQL_PASSWORD_SEI} | |
| Database Name: ${MYSQL_DATABASE_SEI} | |
| Connection URL: mysql://${DATABASE_SERVICE_NAME}:3306/ | |
| SIP: | |
| Username: ${MYSQL_USER_SIP} | |
| Password: ${MYSQL_PASSWORD_SIP} | |
| Database Name: ${MYSQL_DATABASE_SIP} | |
| Connection URL: mysql://${DATABASE_SERVICE_NAME}:3306/ | |
| For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/mysql-container/blob/master/5.7/README.md. | |
| metadata: | |
| labels: | |
| app: sei | |
| name: sei | |
| annotations: | |
| description: |- | |
| MySQL database service, with persistent storage. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/mysql-container/blob/master/5.7/README.md. | |
| NOTE: Scaling to more than one replica is not supported. You must have persistent volumes available in your cluster to use this template. | |
| iconClass: icon-mysql-database | |
| openshift.io/display-name: SEI + MySQL | |
| tags: database,mysql | |
| template.openshift.io/documentation-url: https://docs.openshift.org/latest/using_images/db_images/mysql.html | |
| template.openshift.io/long-description: This template provides a standalone MySQL | |
| server with a database created. The database is stored on persistent storage. The | |
| database name, username, and password are chosen via parameters when provisioning | |
| this service. | |
| template.openshift.io/provider-display-name: Red Hat, Inc. | |
| template.openshift.io/support-url: https://access.redhat.com | |
| parameters: | |
| - description: URL do Git | |
| displayName: URL do Git | |
| name: SEI_GIT_URL | |
| required: true | |
| value: "https://redhatbsb@bitbucket.org/redhatbsb/sei.git" | |
| - description: Versão do SEI | |
| displayName: Versão do SEI | |
| name: SEI_VERSAO | |
| required: true | |
| value: "v3.0.10" | |
| - description: Sigla do orgão (MTE,DPF, etc) | |
| displayName: Sigla Orgão | |
| name: SIGLA_ORGAO | |
| required: true | |
| value: "ABC" | |
| - description: Descrição do orgão (Ministerio xyz) | |
| displayName: Descrição Orgão | |
| name: DESCRICAO_ORGAO | |
| required: true | |
| value: "ORGAO ABC" | |
| - description: Openshift Subdomain (apps.example.com) | |
| displayName: Openshift Subdomain | |
| name: SUBDOMAIN | |
| required: true | |
| - description: Git User | |
| displayName: Git User | |
| name: GIT_USER | |
| required: true | |
| value: cmVkaGF0YnNi | |
| - description: Git Pass | |
| displayName: Git Pass | |
| name: GIT_PASS | |
| required: true | |
| value: cmVkaGF0NGV2ZXI= | |
| - description: Base image path for building SIP and SEI | |
| displayName: Base image | |
| name: BASE_IMAGE | |
| required: true | |
| value: registry.access.redhat.com/rhel:7.5-245 | |
| - description: Image stream output after building base image | |
| displayName: Image stream output | |
| name: IMAGE_STREAM_OUTPUT | |
| required: true | |
| value: rhel:7 | |
| - description: Github trigger secret. A difficult to guess string encoded as part | |
| of the webhook URL. Not encrypted. | |
| displayName: GitHub Webhook Secret | |
| from: '[a-zA-Z0-9]{40}' | |
| generate: expression | |
| name: GITHUB_WEBHOOK_SECRET | |
| - description: A secret string used to configure the Generic webhook. | |
| displayName: Generic Webhook Secret | |
| from: '[a-zA-Z0-9]{40}' | |
| generate: expression | |
| name: GENERIC_WEBHOOK_SECRET | |
| - description: Username for MySQL SIP user that will be used for accessing the database. | |
| displayName: MySQL Connection Username for SIP | |
| from: user[A-Z0-9]{3} | |
| generate: expression | |
| name: MYSQL_USER_SIP | |
| required: true | |
| - description: Password for the MySQL SIP connection user. | |
| displayName: MySQL Connection Password for SIP | |
| from: '[a-zA-Z0-9]{20}' | |
| generate: expression | |
| name: MYSQL_PASSWORD_SIP | |
| required: true | |
| - description: Password for the MySQL SIP root user. | |
| displayName: MySQL root user Password for SIP | |
| from: '[a-zA-Z0-9]{25}' | |
| generate: expression | |
| name: MYSQL_ROOT_PASSWORD_SIP | |
| required: true | |
| - description: Username for MySQL SEI user that will be used for accessing the database. | |
| displayName: MySQL Connection Username for SEI | |
| from: user[A-Z0-9]{3} | |
| generate: expression | |
| name: MYSQL_USER_SEI | |
| required: true | |
| - description: Password for the MySQL SEI connection user. | |
| displayName: MySQL Connection Password for SEI | |
| from: '[a-zA-Z0-9]{20}' | |
| generate: expression | |
| name: MYSQL_PASSWORD_SEI | |
| required: true | |
| - description: Password for the MySQL SEI root user. | |
| displayName: MySQL root user Password for SEI | |
| from: '[a-zA-Z0-9]{25}' | |
| generate: expression | |
| name: MYSQL_ROOT_PASSWORD_SEI | |
| required: true | |
| - description: Volume space available for data for SIP, e.g. 512Mi, 2Gi. | |
| displayName: Volume Capacity for SIP | |
| name: VOLUME_CAPACITY_SIP | |
| required: true | |
| value: 2Gi | |
| - description: Volume space available for data for SEI, e.g. 512Mi, 2Gi. | |
| displayName: Volume Capacity for SEI | |
| name: VOLUME_CAPACITY_SEI | |
| required: true | |
| value: 2Gi | |
| - description: Version of MySQL image to be used (5.5, 5.6, 5.7, or latest). | |
| displayName: Version of MySQL Image | |
| name: MYSQL_VERSION | |
| required: true | |
| value: "5.7" | |
| objects: | |
| # SSH private Key for cloning | |
| - apiVersion: v1 | |
| data: | |
| password: ${GIT_PASS} | |
| username: ${GIT_USER} | |
| kind: Secret | |
| metadata: | |
| name: source-secret | |
| type: kubernetes.io/basic-auth | |
| # Role Binding for Job MySQL | |
| - apiVersion: v1 | |
| kind: RoleBinding | |
| metadata: | |
| name: system:default | |
| roleRef: | |
| kind: Role | |
| name: view | |
| subjects: | |
| - kind: ServiceAccount | |
| name: default | |
| # Job MySQL | |
| - apiVersion: batch/v1 | |
| kind: Job | |
| metadata: | |
| name: sei-job-mysql | |
| spec: | |
| parallelism: 1 | |
| completions: 1 | |
| activeDeadlineSeconds: 10800 | |
| template: | |
| metadata: | |
| name: sei-job-mysql | |
| spec: | |
| containers: | |
| - name: sei-job-mysql | |
| image: docker.io/redhatbsb/govs1-job-mysql:${SEI_VERSAO} | |
| imagePullPolicy: Always | |
| command: ["/opt/run.sh"] | |
| env: | |
| - name: SIP_DB_USERNAME | |
| value: ${MYSQL_USER_SIP} | |
| - name: SIP_DB_PASSWORD | |
| value: ${MYSQL_PASSWORD_SIP} | |
| - name: SIP_DB_HOST | |
| value: sip-mysql | |
| - name: SIP_DB_DATABASE | |
| value: sip | |
| - name: SEI_DB_USERNAME | |
| value: ${MYSQL_USER_SEI} | |
| - name: SEI_DB_PASSWORD | |
| value: ${MYSQL_PASSWORD_SEI} | |
| - name: SEI_DB_HOST | |
| value: sei-mysql | |
| - name: SEI_DB_DATABASE | |
| value: sei | |
| - name: SIGLA_ORGAO | |
| value: ${SIGLA_ORGAO} | |
| - name: DESCRICAO_ORGAO | |
| value: ${DESCRICAO_ORGAO} | |
| restartPolicy: OnFailure | |
| # ImageStream for RHEL 7 | |
| - apiVersion: v1 | |
| kind: ImageStream | |
| metadata: | |
| labels: | |
| app: sei | |
| name: rhel | |
| spec: | |
| lookupPolicy: | |
| local: false | |
| tags: | |
| - name: "7" | |
| from: | |
| kind: DockerImage | |
| name: ${BASE_IMAGE} | |
| # Jod | |
| - apiVersion: v1 | |
| kind: ImageStream | |
| metadata: | |
| labels: | |
| app: sei-jod | |
| name: sei-jod | |
| spec: | |
| lookupPolicy: | |
| local: false | |
| tags: | |
| - name: latest | |
| from: | |
| kind: DockerImage | |
| name: docker.io/redhatbsb/govs1-jod:${SEI_VERSAO} | |
| - apiVersion: v1 | |
| kind: DeploymentConfig | |
| metadata: | |
| labels: | |
| app: sei-jod | |
| name: sei-jod | |
| spec: | |
| replicas: 1 | |
| selector: | |
| app: sei-jod | |
| deploymentconfig: sei-jod | |
| strategy: | |
| activeDeadlineSeconds: 21600 | |
| rollingParams: | |
| intervalSeconds: 1 | |
| maxSurge: 25% | |
| maxUnavailable: 25% | |
| timeoutSeconds: 600 | |
| updatePeriodSeconds: 1 | |
| type: Rolling | |
| template: | |
| metadata: | |
| labels: | |
| app: sei-jod | |
| deploymentconfig: sei-jod | |
| spec: | |
| containers: | |
| - image: sei-jod:latest | |
| imagePullPolicy: Always | |
| livenessProbe: | |
| failureThreshold: 3 | |
| httpGet: | |
| path: /converter/ | |
| port: 8080 | |
| scheme: HTTP | |
| initialDelaySeconds: 180 | |
| periodSeconds: 10 | |
| successThreshold: 1 | |
| timeoutSeconds: 10 | |
| name: sei-jod | |
| ports: | |
| - containerPort: 8080 | |
| protocol: TCP | |
| readinessProbe: | |
| failureThreshold: 3 | |
| httpGet: | |
| path: /converter/ | |
| port: 8080 | |
| scheme: HTTP | |
| periodSeconds: 10 | |
| successThreshold: 1 | |
| timeoutSeconds: 10 | |
| resources: | |
| limits: | |
| cpu: "1" | |
| memory: 1500Mi | |
| requests: | |
| cpu: 100m | |
| memory: 250Mi | |
| dnsPolicy: ClusterFirst | |
| restartPolicy: Always | |
| schedulerName: default-scheduler | |
| securityContext: {} | |
| terminationGracePeriodSeconds: 30 | |
| test: false | |
| triggers: | |
| - type: ConfigChange | |
| - imageChangeParams: | |
| automatic: true | |
| containerNames: | |
| - sei-jod | |
| from: | |
| kind: ImageStreamTag | |
| name: sei-jod:latest | |
| type: ImageChange | |
| - apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| labels: | |
| app: sei-jod | |
| name: sei-jod | |
| spec: | |
| ports: | |
| - name: 8080-tcp | |
| port: 8080 | |
| protocol: TCP | |
| targetPort: 8080 | |
| selector: | |
| deploymentconfig: sei-jod | |
| sessionAffinity: None | |
| type: ClusterIP | |
| - apiVersion: autoscaling/v2beta1 | |
| kind: HorizontalPodAutoscaler | |
| metadata: | |
| labels: | |
| app: sei-jod | |
| name: hpa-sei-jod | |
| spec: | |
| maxReplicas: 3 | |
| minReplicas: 1 | |
| scaleTargetRef: | |
| apiVersion: apps/v1beta1 | |
| kind: ReplicationController | |
| name: sei-jod | |
| metrics: | |
| - type: Resource | |
| resource: | |
| name: memory | |
| targetAverageUtilization: 85 | |
| # Solr | |
| - apiVersion: v1 | |
| kind: ImageStream | |
| metadata: | |
| labels: | |
| app: sei-solr | |
| name: sei-solr | |
| spec: | |
| lookupPolicy: | |
| local: false | |
| tags: | |
| - name: latest | |
| from: | |
| kind: DockerImage | |
| name: docker.io/redhatbsb/govs1-solr:${SEI_VERSAO} | |
| - apiVersion: v1 | |
| kind: DeploymentConfig | |
| metadata: | |
| labels: | |
| app: sei-solr | |
| name: sei-solr | |
| spec: | |
| replicas: 1 | |
| selector: | |
| app: sei-solr | |
| deploymentconfig: sei-solr | |
| strategy: | |
| activeDeadlineSeconds: 21600 | |
| rollingParams: | |
| intervalSeconds: 1 | |
| maxSurge: 25% | |
| maxUnavailable: 25% | |
| timeoutSeconds: 600 | |
| updatePeriodSeconds: 1 | |
| type: Rolling | |
| template: | |
| metadata: | |
| labels: | |
| app: sei-solr | |
| deploymentconfig: sei-solr | |
| spec: | |
| containers: | |
| - image: sei-solr:latest | |
| imagePullPolicy: Always | |
| livenessProbe: | |
| failureThreshold: 3 | |
| httpGet: | |
| path: /solr/ | |
| port: 8983 | |
| scheme: HTTP | |
| initialDelaySeconds: 180 | |
| periodSeconds: 10 | |
| successThreshold: 1 | |
| timeoutSeconds: 5 | |
| name: sei-solr | |
| ports: | |
| - containerPort: 8983 | |
| protocol: TCP | |
| readinessProbe: | |
| failureThreshold: 3 | |
| httpGet: | |
| path: /solr/ | |
| port: 8983 | |
| scheme: HTTP | |
| periodSeconds: 10 | |
| successThreshold: 1 | |
| timeoutSeconds: 5 | |
| resources: | |
| limits: | |
| cpu: "1" | |
| memory: 1500Mi | |
| requests: | |
| cpu: 100m | |
| memory: 350Mi | |
| dnsPolicy: ClusterFirst | |
| restartPolicy: Always | |
| schedulerName: default-scheduler | |
| terminationGracePeriodSeconds: 30 | |
| test: false | |
| triggers: | |
| - type: ConfigChange | |
| - imageChangeParams: | |
| automatic: true | |
| containerNames: | |
| - sei-solr | |
| from: | |
| kind: ImageStreamTag | |
| name: sei-solr:latest | |
| type: ImageChange | |
| - apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| labels: | |
| app: sei-solr | |
| name: sei-solr | |
| spec: | |
| ports: | |
| - name: 8983-tcp | |
| port: 8983 | |
| protocol: TCP | |
| targetPort: 8983 | |
| selector: | |
| deploymentconfig: sei-solr | |
| sessionAffinity: None | |
| type: ClusterIP | |
| - apiVersion: autoscaling/v2beta1 | |
| kind: HorizontalPodAutoscaler | |
| metadata: | |
| labels: | |
| app: sei-solr | |
| name: hpa-sei-solr | |
| spec: | |
| maxReplicas: 3 | |
| minReplicas: 1 | |
| scaleTargetRef: | |
| apiVersion: apps/v1beta1 | |
| kind: DeploymentConfig | |
| name: sei-solr | |
| metrics: | |
| - type: Resource | |
| resource: | |
| name: memory | |
| targetAverageUtilization: 90 | |
| # SEI Httpd base image | |
| - apiVersion: v1 | |
| kind: ImageStream | |
| metadata: | |
| labels: | |
| build: sei-httpd-base | |
| app: sei-httpd-base | |
| name: sei-httpd-base | |
| spec: | |
| lookupPolicy: | |
| local: false | |
| tags: | |
| - name: latest | |
| from: | |
| kind: DockerImage | |
| name: docker.io/redhatbsb/govs1-base-rhel:${SEI_VERSAO} | |
| # Sei memcached | |
| - apiVersion: v1 | |
| kind: ImageStream | |
| metadata: | |
| labels: | |
| app: sei-memcached | |
| name: sei-memcached | |
| spec: | |
| lookupPolicy: | |
| local: false | |
| tags: | |
| - name: latest | |
| from: | |
| kind: DockerImage | |
| name: docker.io/redhatbsb/govs1-memcached:${SEI_VERSAO} | |
| - apiVersion: v1 | |
| kind: DeploymentConfig | |
| metadata: | |
| labels: | |
| app: sei-memcached | |
| name: sei-memcached | |
| spec: | |
| replicas: 1 | |
| selector: | |
| app: sei-memcached | |
| deploymentconfig: sei-memcached | |
| strategy: | |
| activeDeadlineSeconds: 21600 | |
| rollingParams: | |
| intervalSeconds: 1 | |
| maxSurge: 25% | |
| maxUnavailable: 25% | |
| timeoutSeconds: 600 | |
| updatePeriodSeconds: 1 | |
| type: Rolling | |
| template: | |
| metadata: | |
| labels: | |
| app: sei-memcached | |
| deploymentconfig: sei-memcached | |
| spec: | |
| containers: | |
| - image: sei-memcached:latest | |
| imagePullPolicy: Always | |
| livenessProbe: | |
| failureThreshold: 3 | |
| initialDelaySeconds: 180 | |
| periodSeconds: 10 | |
| successThreshold: 1 | |
| tcpSocket: | |
| port: 11211 | |
| timeoutSeconds: 10 | |
| name: sei-memcached | |
| ports: | |
| - containerPort: 11211 | |
| protocol: TCP | |
| readinessProbe: | |
| failureThreshold: 3 | |
| periodSeconds: 10 | |
| successThreshold: 1 | |
| tcpSocket: | |
| port: 11211 | |
| timeoutSeconds: 10 | |
| resources: | |
| limits: | |
| cpu: "1" | |
| memory: 500Mi | |
| requests: | |
| cpu: 100m | |
| memory: 100Mi | |
| dnsPolicy: ClusterFirst | |
| restartPolicy: Always | |
| schedulerName: default-scheduler | |
| terminationGracePeriodSeconds: 30 | |
| test: false | |
| triggers: | |
| - type: ConfigChange | |
| - imageChangeParams: | |
| automatic: true | |
| containerNames: | |
| - sei-memcached | |
| from: | |
| kind: ImageStreamTag | |
| name: sei-memcached:latest | |
| type: ImageChange | |
| - apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| labels: | |
| app: sei-memcached | |
| name: sei-memcached | |
| spec: | |
| ports: | |
| - name: 11211-tcp | |
| port: 11211 | |
| protocol: TCP | |
| targetPort: 11211 | |
| selector: | |
| deploymentconfig: sei-memcached | |
| sessionAffinity: None | |
| type: ClusterIP | |
| - apiVersion: autoscaling/v2beta1 | |
| kind: HorizontalPodAutoscaler | |
| metadata: | |
| labels: | |
| app: sei-memcached | |
| name: hpa-sei-memcached | |
| spec: | |
| maxReplicas: 3 | |
| minReplicas: 1 | |
| scaleTargetRef: | |
| apiVersion: apps/v1beta1 | |
| kind: DeploymentConfig | |
| name: sei-memcached | |
| metrics: | |
| - type: Resource | |
| resource: | |
| name: memory | |
| targetAverageUtilization: 90 | |
| # SEI MySQL | |
| - apiVersion: v1 | |
| kind: Secret | |
| metadata: | |
| annotations: | |
| template.openshift.io/expose-password: '{.data[''database-password'']}' | |
| template.openshift.io/expose-root_password: '{.data[''database-root-password'']}' | |
| template.openshift.io/expose-username: '{.data[''database-user'']}' | |
| name: sei-mysql | |
| stringData: | |
| database-password: ${MYSQL_PASSWORD_SEI} | |
| database-root-password: ${MYSQL_ROOT_PASSWORD_SEI} | |
| database-user: ${MYSQL_USER_SEI} | |
| - apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| annotations: | |
| template.openshift.io/expose-uri: mysql://{.spec.clusterIP}:{.spec.ports[?(.name=="mysql")].port} | |
| name: sei-mysql | |
| spec: | |
| ports: | |
| - name: mysql | |
| port: 3306 | |
| selector: | |
| name: sei-mysql | |
| - apiVersion: v1 | |
| kind: PersistentVolumeClaim | |
| metadata: | |
| name: sei-mysql | |
| spec: | |
| accessModes: | |
| - ReadWriteOnce | |
| resources: | |
| requests: | |
| storage: ${VOLUME_CAPACITY_SEI} | |
| - apiVersion: v1 | |
| kind: DeploymentConfig | |
| metadata: | |
| name: sei-mysql | |
| spec: | |
| replicas: 1 | |
| selector: | |
| name: sei-mysql | |
| strategy: | |
| type: Recreate | |
| rollingParams: | |
| pos: | |
| failurePolicy: Ignore | |
| template: | |
| metadata: | |
| labels: | |
| name: sei-mysql | |
| spec: | |
| containers: | |
| - env: | |
| - name: MYSQL_USER | |
| valueFrom: | |
| secretKeyRef: | |
| key: database-user | |
| name: sei-mysql | |
| - name: MYSQL_PASSWORD | |
| valueFrom: | |
| secretKeyRef: | |
| key: database-password | |
| name: sei-mysql | |
| - name: MYSQL_ROOT_PASSWORD | |
| valueFrom: | |
| secretKeyRef: | |
| key: database-root-password | |
| name: sei-mysql | |
| - name: MYSQL_DATABASE | |
| value: sei | |
| image: ' ' | |
| imagePullPolicy: IfNotPresent | |
| livenessProbe: | |
| initialDelaySeconds: 30 | |
| tcpSocket: | |
| port: 3306 | |
| timeoutSeconds: 1 | |
| name: mysql | |
| ports: | |
| - containerPort: 3306 | |
| readinessProbe: | |
| exec: | |
| command: | |
| - /bin/sh | |
| - -i | |
| - -c | |
| - MYSQL_PWD="$MYSQL_PASSWORD" mysql -h 127.0.0.1 -u $MYSQL_USER -D $MYSQL_DATABASE | |
| -e 'SELECT 1' | |
| initialDelaySeconds: 5 | |
| timeoutSeconds: 1 | |
| resources: | |
| limits: | |
| memory: 1Gi | |
| volumeMounts: | |
| - mountPath: /var/lib/mysql/data | |
| name: sei-mysql-data | |
| volumes: | |
| - name: sei-mysql-data | |
| persistentVolumeClaim: | |
| claimName: sei-mysql | |
| triggers: | |
| - imageChangeParams: | |
| automatic: true | |
| containerNames: | |
| - mysql | |
| from: | |
| kind: ImageStreamTag | |
| name: mysql:${MYSQL_VERSION} | |
| namespace: openshift | |
| type: ImageChange | |
| - type: ConfigChange | |
| # SIP MySQL | |
| - apiVersion: v1 | |
| kind: Secret | |
| metadata: | |
| annotations: | |
| template.openshift.io/expose-password: '{.data[''database-password'']}' | |
| template.openshift.io/expose-root_password: '{.data[''database-root-password'']}' | |
| template.openshift.io/expose-username: '{.data[''database-user'']}' | |
| name: sip-mysql | |
| stringData: | |
| database-password: ${MYSQL_PASSWORD_SIP} | |
| database-root-password: ${MYSQL_ROOT_PASSWORD_SIP} | |
| database-user: ${MYSQL_USER_SIP} | |
| - apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| annotations: | |
| template.openshift.io/expose-uri: mysql://{.spec.clusterIP}:{.spec.ports[?(.name=="mysql")].port} | |
| name: sip-mysql | |
| spec: | |
| ports: | |
| - name: mysql | |
| port: 3306 | |
| selector: | |
| name: sip-mysql | |
| - apiVersion: v1 | |
| kind: PersistentVolumeClaim | |
| metadata: | |
| name: sip-mysql | |
| spec: | |
| accessModes: | |
| - ReadWriteOnce | |
| resources: | |
| requests: | |
| storage: ${VOLUME_CAPACITY_SIP} | |
| - apiVersion: v1 | |
| kind: DeploymentConfig | |
| metadata: | |
| name: sip-mysql | |
| spec: | |
| replicas: 1 | |
| selector: | |
| name: sip-mysql | |
| strategy: | |
| type: Recreate | |
| template: | |
| metadata: | |
| labels: | |
| name: sip-mysql | |
| spec: | |
| containers: | |
| - env: | |
| - name: MYSQL_USER | |
| valueFrom: | |
| secretKeyRef: | |
| key: database-user | |
| name: sip-mysql | |
| - name: MYSQL_PASSWORD | |
| valueFrom: | |
| secretKeyRef: | |
| key: database-password | |
| name: sip-mysql | |
| - name: MYSQL_ROOT_PASSWORD | |
| valueFrom: | |
| secretKeyRef: | |
| key: database-root-password | |
| name: sip-mysql | |
| - name: MYSQL_DATABASE | |
| value: sip | |
| image: ' ' | |
| imagePullPolicy: IfNotPresent | |
| livenessProbe: | |
| initialDelaySeconds: 30 | |
| tcpSocket: | |
| port: 3306 | |
| timeoutSeconds: 1 | |
| name: mysql | |
| ports: | |
| - containerPort: 3306 | |
| readinessProbe: | |
| exec: | |
| command: | |
| - /bin/sh | |
| - -i | |
| - -c | |
| - MYSQL_PWD="$MYSQL_PASSWORD" mysql -h 127.0.0.1 -u $MYSQL_USER -D $MYSQL_DATABASE | |
| -e 'SELECT 1' | |
| initialDelaySeconds: 5 | |
| timeoutSeconds: 1 | |
| resources: | |
| limits: | |
| memory: 1Gi | |
| volumeMounts: | |
| - mountPath: /var/lib/mysql/data | |
| name: sip-mysql-data | |
| volumes: | |
| - name: sip-mysql-data | |
| persistentVolumeClaim: | |
| claimName: sip-mysql | |
| triggers: | |
| - imageChangeParams: | |
| automatic: true | |
| containerNames: | |
| - mysql | |
| from: | |
| kind: ImageStreamTag | |
| name: mysql:${MYSQL_VERSION} | |
| namespace: openshift | |
| type: ImageChange | |
| - type: ConfigChange | |
| # SIP | |
| - apiVersion: v1 | |
| kind: BuildConfig | |
| metadata: | |
| labels: | |
| build: sip-web | |
| app: sip-web | |
| name: sip-web | |
| spec: | |
| failedBuildsHistoryLimit: 5 | |
| output: | |
| to: | |
| kind: ImageStreamTag | |
| name: sip-web:latest | |
| postCommit: {} | |
| source: | |
| contextDir: sip | |
| git: | |
| uri: ${SEI_GIT_URL} | |
| ref: ${SEI_VERSAO} | |
| sourceSecret: | |
| name: source-secret | |
| type: Git | |
| strategy: | |
| dockerStrategy: | |
| from: | |
| kind: ImageStreamTag | |
| name: sei-httpd-base:latest | |
| type: Docker | |
| successfulBuildsHistoryLimit: 5 | |
| triggers: | |
| - github: | |
| secret: ${GITHUB_WEBHOOK_SECRET} | |
| type: GitHub | |
| - generic: | |
| secret: ${GENERIC_WEBHOOK_SECRET} | |
| type: Generic | |
| - imageChange: {} | |
| type: ImageChange | |
| - type: ConfigChange | |
| - apiVersion: v1 | |
| kind: ImageStream | |
| metadata: | |
| labels: | |
| build: sip-web | |
| app: sip-web | |
| name: sip-web | |
| spec: | |
| dockerImageRepository: | |
| tags: | |
| - name: latest | |
| - apiVersion: v1 | |
| kind: DeploymentConfig | |
| metadata: | |
| labels: | |
| app: sip-web | |
| name: sip-web | |
| spec: | |
| replicas: 1 | |
| selector: | |
| app: sip-web | |
| deploymentconfig: sip-web | |
| strategy: | |
| activeDeadlineSeconds: 21600 | |
| rollingParams: | |
| intervalSeconds: 1 | |
| maxSurge: 25% | |
| maxUnavailable: 25% | |
| timeoutSeconds: 600 | |
| updatePeriodSeconds: 1 | |
| type: Rolling | |
| template: | |
| metadata: | |
| labels: | |
| app: sip-web | |
| deploymentconfig: sip-web | |
| spec: | |
| containers: | |
| - env: | |
| - name: SEI_DATABASE_DATABASE | |
| value: sei | |
| - name: SEI_DATABASE_HOST | |
| value: sei-mysql | |
| - name: SEI_DATABASE_PASS | |
| value: ${MYSQL_PASSWORD_SEI} | |
| - name: SEI_DATABASE_PORT | |
| value: "3306" | |
| - name: SEI_DATABASE_TYPE | |
| value: MySql | |
| - name: SEI_DATABASE_USER | |
| value: ${MYSQL_USER_SEI} | |
| - name: SEI_DOTNET_HOST | |
| value: 127.0.0.1 | |
| - name: SEI_HOST_URL | |
| value: http://sei.${SUBDOMAIN} | |
| - name: SEI_JOD_HOST | |
| value: sei-jod | |
| - name: SEI_MEMCACHED_HOST | |
| value: sei-memcached | |
| - name: SEI_MEMCACHED_PORT | |
| value: "11211" | |
| - name: SEI_SMTP_HOST | |
| value: 127.0.0.1 | |
| - name: SEI_SOLR_HOST | |
| value: sei-solr | |
| - name: SIP_DATABASE_DATABASE | |
| value: sip | |
| - name: SIP_DATABASE_HOST | |
| value: sip-mysql | |
| - name: SIP_DATABASE_PASS | |
| value: ${MYSQL_PASSWORD_SIP} | |
| - name: SIP_DATABASE_PORT | |
| value: "3306" | |
| - name: SIP_DATABASE_TYPE | |
| value: MySql | |
| - name: SIP_DATABASE_USER | |
| value: ${MYSQL_USER_SIP} | |
| - name: SIP_HOST_URL | |
| value: http://sei.${SUBDOMAIN} | |
| - name: SIGLA_ORGAO | |
| value: ${SIGLA_ORGAO} | |
| - name: DESCRICAO_ORGAO | |
| value: ${DESCRICAO_ORGAO} | |
| image: sip-web:latest | |
| imagePullPolicy: Always | |
| livenessProbe: | |
| failureThreshold: 3 | |
| httpGet: | |
| path: /sip/css/infra-esquema-local.css | |
| port: 80 | |
| scheme: HTTP | |
| initialDelaySeconds: 180 | |
| periodSeconds: 10 | |
| successThreshold: 1 | |
| timeoutSeconds: 10 | |
| name: sip-web | |
| ports: | |
| - containerPort: 80 | |
| protocol: TCP | |
| readinessProbe: | |
| failureThreshold: 3 | |
| httpGet: | |
| path: /sip/css/infra-esquema-local.css | |
| port: 80 | |
| scheme: HTTP | |
| periodSeconds: 10 | |
| successThreshold: 1 | |
| timeoutSeconds: 10 | |
| resources: | |
| limits: | |
| cpu: "2" | |
| memory: 1000Mi | |
| requests: | |
| cpu: 100m | |
| memory: 100Mi | |
| dnsPolicy: ClusterFirst | |
| restartPolicy: Always | |
| schedulerName: default-scheduler | |
| terminationGracePeriodSeconds: 30 | |
| test: false | |
| triggers: | |
| - type: ConfigChange | |
| - imageChangeParams: | |
| automatic: true | |
| containerNames: | |
| - sip-web | |
| from: | |
| kind: ImageStreamTag | |
| name: sip-web:latest | |
| type: ImageChange | |
| - apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| labels: | |
| app: sip-web | |
| name: sip-web | |
| spec: | |
| ports: | |
| - name: 80-tcp | |
| port: 80 | |
| protocol: TCP | |
| targetPort: 80 | |
| selector: | |
| deploymentconfig: sip-web | |
| sessionAffinity: None | |
| type: ClusterIP | |
| - apiVersion: v1 | |
| kind: Route | |
| metadata: | |
| name: sip-web | |
| spec: | |
| host: sip.${SUBDOMAIN} | |
| port: | |
| targetPort: 80-tcp | |
| to: | |
| kind: Service | |
| name: sip-web | |
| weight: 100 | |
| wildcardPolicy: None | |
| - apiVersion: autoscaling/v2beta1 | |
| kind: HorizontalPodAutoscaler | |
| metadata: | |
| labels: | |
| app: sip-web | |
| name: hpa-sip-web | |
| spec: | |
| maxReplicas: 5 | |
| minReplicas: 1 | |
| scaleTargetRef: | |
| apiVersion: apps/v1beta1 | |
| kind: DeploymentConfig | |
| name: sip-web | |
| metrics: | |
| - type: Resource | |
| resource: | |
| name: cpu | |
| targetAverageUtilization: 90 | |
| # SEI | |
| - apiVersion: v1 | |
| kind: BuildConfig | |
| metadata: | |
| labels: | |
| app: sei-web | |
| build: sei-web | |
| name: sei-web | |
| spec: | |
| failedBuildsHistoryLimit: 5 | |
| output: | |
| to: | |
| kind: ImageStreamTag | |
| name: sei-web:latest | |
| source: | |
| contextDir: sei | |
| git: | |
| uri: ${SEI_GIT_URL} | |
| ref: ${SEI_VERSAO} | |
| sourceSecret: | |
| name: source-secret | |
| type: Git | |
| strategy: | |
| dockerStrategy: | |
| from: | |
| kind: ImageStreamTag | |
| name: sei-httpd-base:latest | |
| type: Docker | |
| successfulBuildsHistoryLimit: 5 | |
| triggers: | |
| - github: | |
| secret: ${GITHUB_WEBHOOK_SECRET} | |
| type: GitHub | |
| - generic: | |
| secret: ${GENERIC_WEBHOOK_SECRET} | |
| type: Generic | |
| - imageChange: {} | |
| type: ImageChange | |
| - type: ConfigChange | |
| - apiVersion: v1 | |
| kind: ImageStream | |
| metadata: | |
| annotations: | |
| openshift.io/display-name: SEI | |
| labels: | |
| build: sei-web | |
| app: sei-web | |
| name: sei-web | |
| spec: | |
| dockerImageRepository: | |
| tags: | |
| - name: latest | |
| annotations: | |
| description: |- | |
| Build and run SEI applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-php-container/blob/master/5.6/README.md. | |
| WARNING: By selecting this tag, your application will automatically update to use the latest version of PHP available on OpenShift, including major versions updates. | |
| iconClass: icon-php | |
| openshift.io/display-name: SEI (Latest) | |
| openshift.io/provider-display-name: Red Hat, Inc. | |
| sampleRepo: https://github.com/openshift/cakephp-ex.git | |
| supports: php | |
| - apiVersion: v1 | |
| kind: DeploymentConfig | |
| metadata: | |
| labels: | |
| app: sei-web | |
| name: sei-web | |
| spec: | |
| replicas: 1 | |
| selector: | |
| app: sei-web | |
| deploymentconfig: sei-web | |
| strategy: | |
| activeDeadlineSeconds: 21600 | |
| rollingParams: | |
| intervalSeconds: 1 | |
| maxSurge: 25% | |
| maxUnavailable: 25% | |
| timeoutSeconds: 600 | |
| updatePeriodSeconds: 1 | |
| type: Rolling | |
| template: | |
| metadata: | |
| labels: | |
| app: sei-web | |
| deploymentconfig: sei-web | |
| spec: | |
| containers: | |
| - env: | |
| - name: SEI_DATABASE_DATABASE | |
| value: sei | |
| - name: SEI_DATABASE_HOST | |
| value: sei-mysql | |
| - name: SEI_DATABASE_PASS | |
| value: ${MYSQL_PASSWORD_SEI} | |
| - name: SEI_DATABASE_PORT | |
| value: "3306" | |
| - name: SEI_DATABASE_TYPE | |
| value: MySql | |
| - name: SEI_DATABASE_USER | |
| value: ${MYSQL_USER_SEI} | |
| - name: SEI_DOTNET_HOST | |
| value: 127.0.0.1 | |
| - name: SEI_HOST_URL | |
| value: http://sei.${SUBDOMAIN} | |
| - name: SEI_JOD_HOST | |
| value: sei-jod | |
| - name: SEI_MEMCACHED_HOST | |
| value: sei-memcached | |
| - name: SEI_MEMCACHED_PORT | |
| value: "11211" | |
| - name: SEI_SMTP_HOST | |
| value: 127.0.0.1 | |
| - name: SEI_SOLR_HOST | |
| value: sei-solr | |
| - name: SIP_DATABASE_DATABASE | |
| value: sip | |
| - name: SIP_DATABASE_HOST | |
| value: sip-mysql | |
| - name: SIP_DATABASE_PASS | |
| value: ${MYSQL_PASSWORD_SIP} | |
| - name: SIP_DATABASE_PORT | |
| value: "3306" | |
| - name: SIP_DATABASE_TYPE | |
| value: MySql | |
| - name: SIP_DATABASE_USER | |
| value: ${MYSQL_USER_SIP} | |
| - name: SIP_HOST_URL | |
| value: http://sei.${SUBDOMAIN} | |
| - name: SIGLA_ORGAO | |
| value: ${SIGLA_ORGAO} | |
| - name: DESCRICAO_ORGAO | |
| value: ${DESCRICAO_ORGAO} | |
| image: sei-web:latest | |
| imagePullPolicy: Always | |
| livenessProbe: | |
| failureThreshold: 3 | |
| httpGet: | |
| path: /sei/controlador_externo.php?acao=documento_conferir&id_orgao_acesso_externo=0 | |
| port: 80 | |
| scheme: HTTP | |
| initialDelaySeconds: 180 | |
| periodSeconds: 10 | |
| successThreshold: 1 | |
| timeoutSeconds: 10 | |
| name: sei-web | |
| ports: | |
| - containerPort: 80 | |
| protocol: TCP | |
| readinessProbe: | |
| failureThreshold: 3 | |
| httpGet: | |
| path: /sei/controlador_externo.php?acao=documento_conferir&id_orgao_acesso_externo=0 | |
| port: 80 | |
| scheme: HTTP | |
| periodSeconds: 10 | |
| successThreshold: 1 | |
| timeoutSeconds: 10 | |
| resources: | |
| limits: | |
| cpu: "2" | |
| memory: 500Mi | |
| requests: | |
| cpu: 100m | |
| memory: 100Mi | |
| volumeMounts: | |
| - mountPath: /var/sei/arquivos | |
| name: volume-1qw3q | |
| dnsPolicy: ClusterFirst | |
| restartPolicy: Always | |
| schedulerName: default-scheduler | |
| terminationGracePeriodSeconds: 30 | |
| volumes: | |
| - name: volume-1qw3q | |
| persistentVolumeClaim: | |
| claimName: sei-web | |
| test: false | |
| triggers: | |
| - type: ConfigChange | |
| - imageChangeParams: | |
| automatic: true | |
| containerNames: | |
| - sei-web | |
| from: | |
| kind: ImageStreamTag | |
| name: sei-web:latest | |
| type: ImageChange | |
| - apiVersion: v1 | |
| kind: PersistentVolumeClaim | |
| metadata: | |
| labels: | |
| app: sei-web | |
| name: sei-web | |
| spec: | |
| accessModes: | |
| - ReadWriteOnce | |
| resources: | |
| requests: | |
| storage: 5Gi | |
| - apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| labels: | |
| app: sei-web | |
| name: sei-web | |
| spec: | |
| ports: | |
| - name: 80-tcp | |
| port: 80 | |
| protocol: TCP | |
| targetPort: 80 | |
| selector: | |
| deploymentconfig: sei-web | |
| sessionAffinity: None | |
| type: ClusterIP | |
| - apiVersion: v1 | |
| kind: Route | |
| metadata: | |
| name: sei-web | |
| spec: | |
| host: sei.${SUBDOMAIN} | |
| port: | |
| targetPort: 80-tcp | |
| to: | |
| kind: Service | |
| name: sei-web | |
| weight: 100 | |
| wildcardPolicy: None | |
| - apiVersion: autoscaling/v2beta1 | |
| kind: HorizontalPodAutoscaler | |
| metadata: | |
| labels: | |
| app: sei-web | |
| name: hpa-sei-web | |
| spec: | |
| maxReplicas: 5 | |
| minReplicas: 1 | |
| scaleTargetRef: | |
| apiVersion: apps/v1beta1 | |
| kind: DeploymentConfig | |
| name: sei-web | |
| metrics: | |
| - type: Resource | |
| resource: | |
| name: memory | |
| targetAverageUtilization: 90 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment