New file |
| | |
| | | --- |
| | | kind: Template |
| | | apiVersion: v1 |
| | | metadata: |
| | | annotations: |
| | | iconClass: icon-jboss |
| | | tags: rhdm,angujar,nodejs |
| | | version: "4.0" |
| | | openshift.io/display-name: Angular JS Application to interact with Red Hat Decision Manager 7.1 |
| | | openshift.io/provider-display-name: Red Hat, Inc. - GPTE |
| | | description: Angular JS Application to interact with Red Hat Decision Manager 7 Created with education purposes of foundational course |
| | | template.openshift.io/long-description: Angular JS Application to interact with Red Hat Decision Manager 7 Created with education purposes of foundational course |
| | | template.openshift.io/documentation-url: https://access.redhat.com/documentation/en-us/red_hat_decision_manager/7.1/html/deploying_a_red_hat_decision_manager_7.1_authoring_environment_on_red_hat_openshift_container_platform/ |
| | | template.openshift.io/support-url: https://access.redhat.com |
| | | template.openshift.io/bindable: "false" |
| | | name: ng-dmf-template |
| | | labels: |
| | | template: ng-dmf-template |
| | | rhdm: "7.6" |
| | | message: |- |
| | | A new angular application to interact with RHDM7.6 Has been created. |
| | | parameters: |
| | | - displayName: Application Name |
| | | description: The name for the application. |
| | | name: APPLICATION_NAME |
| | | value: myapp |
| | | required: true |
| | | - description: nginx.conf template. It will be copied to config map and used instead of /etc/nginx/nginx.conf |
| | | displayName: nginx.conf |
| | | name: NGINX_CONFIG |
| | | required: true |
| | | value: | |
| | | worker_processes 1; |
| | | #worker_processes auto; |
| | | worker_rlimit_nofile 2048; |
| | | #error_log logs/error.log; |
| | | #error_log logs/error.log notice; |
| | | #error_log logs/error.log info; |
| | | events { |
| | | worker_connections 1024; |
| | | multi_accept on; |
| | | use epoll; |
| | | } |
| | | http { |
| | | #fix temp paths |
| | | client_body_temp_path /tmp/nginx/client_temp 1 2; |
| | | proxy_temp_path /tmp/nginx/proxy_temp 1 2; |
| | | fastcgi_temp_path /tmp/nginx/fastcgi_temp 1 2; |
| | | uwsgi_temp_path /tmp/nginx/uwsgi_temp 1 2; |
| | | scgi_temp_path /tmp/nginx/scgi_temp 1 2; |
| | | include /etc/nginx/mime.types; |
| | | default_type application/octet-stream; |
| | | #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' |
| | | # '$status $body_bytes_sent "$http_referer" ' |
| | | # '"$http_user_agent" "$http_x_forwarded_for"'; |
| | | #access_log logs/access.log main; |
| | | access_log /dev/stdout; |
| | | error_log /dev/stderr; |
| | | sendfile on; |
| | | server_tokens off; |
| | | tcp_nopush on; |
| | | tcp_nodelay on; |
| | | types_hash_max_size 2048; |
| | | client_max_body_size 20M; |
| | | open_file_cache max=1000; |
| | | #keepalive_timeout 0; |
| | | keepalive_timeout 65; |
| | | #gzip on; |
| | | gzip on; |
| | | gzip_vary on; |
| | | gzip_disable "msie6"; |
| | | gzip_comp_level 6; |
| | | gzip_min_length 1100; |
| | | gzip_buffers 16 8k; |
| | | gzip_proxied any; |
| | | gzip_types |
| | | text/plain |
| | | text/css |
| | | text/js |
| | | text/xml |
| | | text/javascript |
| | | application/javascript |
| | | application/x-javascript |
| | | application/json |
| | | application/xml |
| | | application/xml+rss; |
| | | large_client_header_buffers 4 32k; |
| | | server_names_hash_bucket_size 64; |
| | | charset UTF-8; |
| | | #server configs are stored in ConfigMap as separate fields |
| | | include /etc/nginx/openshift/*.conf; |
| | | } |
| | | - description: default site template, later you can add more 'files' into config map as well |
| | | displayName: default.conf |
| | | name: NGINX_WWW_CONFIG |
| | | required: true |
| | | value: | |
| | | server { |
| | | listen 8080 default_server; |
| | | listen [::]:8080 default_server ipv6only=on; |
| | | location / { |
| | | root /usr/share/nginx/html; |
| | | index index.html index.htm; |
| | | } |
| | | error_page 500 502 503 504 /50x.html; |
| | | location = /50x.html { |
| | | root /usr/share/nginx/html; |
| | | } |
| | | } |
| | | objects: |
| | | - apiVersion: v1 |
| | | kind: ServiceAccount |
| | | metadata: |
| | | name: sa-nginx |
| | | - apiVersion: v1 |
| | | kind: ImageStream |
| | | metadata: |
| | | creationTimestamp: null |
| | | labels: |
| | | app: ${APPLICATION_NAME} |
| | | application: ${APPLICATION_NAME} |
| | | name: is-ng-dmf |
| | | spec: |
| | | dockerImageRepository: "" |
| | | tags: |
| | | - |
| | | from: |
| | | kind: DockerImage |
| | | name: "{{angular_image}}" |
| | | name: ng-dmf_pseudo_tag |
| | | importPolicy: |
| | | scheduled: true |
| | | status: |
| | | dockerImageRepository: "" |
| | | - apiVersion: v1 |
| | | kind: ConfigMap |
| | | metadata: |
| | | name: cm-ng-dmf-nginx-config |
| | | data: |
| | | nginx.conf.template: | |
| | | ${NGINX_CONFIG} |
| | | default.conf: | |
| | | ${NGINX_WWW_CONFIG} |
| | | - apiVersion: v1 |
| | | kind: Service |
| | | metadata: |
| | | annotations: |
| | | description: The nodejs web server's http port for the angular application demo. |
| | | labels: |
| | | application: ${APPLICATION_NAME} |
| | | name: ${APPLICATION_NAME}-ng-dmf |
| | | spec: |
| | | ports: |
| | | - port: 8080 |
| | | targetPort: 8080 |
| | | selector: |
| | | deploymentConfig: ${APPLICATION_NAME}-ng-dmf |
| | | - apiVersion: v1 |
| | | id: ${APPLICATION_NAME}-ng-dmf-http |
| | | kind: Route |
| | | metadata: |
| | | annotations: |
| | | description: Route for nodejs mortgages http service. |
| | | labels: |
| | | application: ${APPLICATION_NAME} |
| | | name: ${APPLICATION_NAME}-ng-dmf |
| | | spec: |
| | | to: |
| | | name: ${APPLICATION_NAME}-ng-dmf |
| | | - apiVersion: v1 |
| | | kind: DeploymentConfig |
| | | metadata: |
| | | labels: |
| | | application: ${APPLICATION_NAME} |
| | | name: ${APPLICATION_NAME}-ng-dmf |
| | | spec: |
| | | paused: false |
| | | replicas: 1 |
| | | selector: |
| | | deploymentConfig: ${APPLICATION_NAME}-ng-dmf |
| | | strategy: |
| | | type: Rolling |
| | | template: |
| | | metadata: |
| | | labels: |
| | | application: ${APPLICATION_NAME} |
| | | deploymentConfig: ${APPLICATION_NAME}-ng-dmf |
| | | name: ${APPLICATION_NAME}-ng-dmf |
| | | spec: |
| | | containers: |
| | | - image: "{{angular_image}}" |
| | | imagePullPolicy: Always |
| | | livenessProbe: |
| | | failureThreshold: 10 |
| | | initialDelaySeconds: 50 |
| | | periodSeconds: 10 |
| | | tcpSocket: |
| | | port: 8080 |
| | | timeoutSeconds: 1 |
| | | readinessProbe: |
| | | initialDelaySeconds: 50 |
| | | failureThreshold: 30 |
| | | periodSeconds: 10 |
| | | tcpSocket: |
| | | port: 8080 |
| | | timeoutSeconds: 1 |
| | | name: ${APPLICATION_NAME}-ng-dmf |
| | | ports: |
| | | - containerPort: 8080 |
| | | name: http |
| | | protocol: TCP |
| | | resources: |
| | | limits: |
| | | cpu: "0.5" |
| | | memory: 512Mi |
| | | requests: |
| | | cpu: "0.25" |
| | | memory: 256Mi |
| | | command: |
| | | - /bin/sh |
| | | - '-c' |
| | | - >- |
| | | mkdir /tmp/nginx && |
| | | nginx -c /etc/nginx/openshift/nginx.conf.template -g 'daemon off; pid /tmp/nginx.pid;' |
| | | volumeMounts: |
| | | - mountPath: /etc/nginx/openshift |
| | | name: vol-ng-dmf-nginx-conf |
| | | terminationMessagePath: /dev/termination-log |
| | | serviceAccountName: sa-nginx |
| | | volumes: |
| | | - configMap: |
| | | name: cm-ng-dmf-nginx-config |
| | | name: vol-ng-dmf-nginx-conf |
| | | triggers: |
| | | - imageChangeParams: |
| | | automatic: true |
| | | containerNames: |
| | | - ${APPLICATION_NAME}-ng-dmf |
| | | from: |
| | | kind: ImageStreamTag |
| | | name: is-ng-dmf:ng-dmf_pseudo_tag |
| | | type: ImageChange |
| | | - type: ConfigChange |