Untitled

                Never    
YAML
       
# apiVersion: v1
# kind: Namespace
# metadata:
#   name: abstract-component-library-test-review-app-3614
# ---
apiVersion: v1
data:
  .dockerconfigjson: eyJhdXRocyI6eyJnaXRsYWIuc2NjbG91ZC5ydTo1NTU1Ijp7InVzZXJuYW1lIjoicm9ib3QiLCJwYXNzd29yZCI6ImxMRDZRVEt0IiwiZW1haWwiOiJsb3JkbGV0b3NAZ21haWwuY29tIiwiYXV0aCI6ImNtOWliM1E2YkV4RU5sRlVTM1E9In19fQ==
kind: Secret
metadata:
  name: regcred-3614
  # namespace: abstract-component-library-test-review-app-3614
type: kubernetes.io/dockerconfigjson
# ---
# kind: Service
# apiVersion: v1
# metadata:
#   name: review-abstract-c-jgibj2
#   # namespace: abstract-component-library-test-review-app-3614
# spec:
#   selector:
#     app: review-abstract-c-jgibj2
#   ports:
#   - name: "abstract-component-library"
#     protocol: TCP
#     port: 8003
# #  type: LoadBalancer # You may want to replace LoadBalancer with Ingress: just comment this line and uncomment Ingress definition below
---
kind: Service
apiVersion: v1
metadata:
  name: review-abstract-c-jgibj2
  # namespace: abstract-component-library-test-review-app-3614
spec:
  selector:
    app: review-abstract-c-jgibj2
  ports:
  - name: "abstract-component-library"
    protocol: TCP
    port: 80
#  type: LoadBalancer # You may want to replace LoadBalancer with Ingress: just comment this line and uncomment Ingress definition below
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
 annotations:
   kubernetes.io/ingress.class: nginx
   # nginx.ingress.kubernetes.io/proxy-body-size: "0"
   nginx.ingress.kubernetes.io/lb-method: round_robin
   nginx.ingress.kubernetes.io/websocket-services: review-abstract-c-jgibj2
   # nginx.org/websocket-services: review-abstract-c-jgibj2
   # nginx.ingress.kubernetes.io/configuration-snippet: |
   #   proxy_http_version 1.1;
   #   proxy_set_header Upgrade "websocket";
   #   proxy_set_header Connection "Upgrade";
 name: review-abstract-c-jgibj2-3614
 # namespace: abstract-component-library-test-review-app-3614
spec:
 rules:
   - host: np.k8.sccloud.ru # Replace with correct cluster FQDN
     http:
       paths:
         - path: /
           backend:
             serviceName: review-abstract-c-jgibj2
             servicePort: 80
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: review-abstract-c-jgibj2-3614
  # namespace: abstract-component-library-test-review-app-3614
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: review-abstract-c-jgibj2
    spec:
      containers:
      - name: abstract-component-library
        image: gitlab.sccloud.ru:5555/sc/abstract-component-library/test-review-app/build:3614
        env:
        # - name: SFS_SERVER_PORT
        #   value: 8002
        # - name: SFS_MINIO_DELETE_BUCKET
        #   value: "test"
        - name: SFS_MINIO_ENDPOINT
          value: "singing-donkey-minio.minio.svc.cluster.local"
        - name: SFS_MINIO_PORT
          value: "9000"
        - name: EXCHANGE_RABBIT_HOST
          value: "amqp://rabbitmq:rabbitmq@rabbitmq.rabbitmq.svc.cluster.local:5672"
        - name: STORAGE_ETCD_HOSTS
          value: "example-etcd-cluster-client.default.svc.cluster.local:2379"
        - name: STORAGE_MONGODB_PREFIX
          value: "3614_"
        - name: STORAGE_MONGODB_URL
          value: "mongodb-replicaset-0.mongodb-replicaset.mongodb-replicaset.svc.cluster.local,mongodb-replicaset-1.mongodb-replicaset.mongodb-replicaset.svc.cluster.local,mongodb-replicaset-2.mongodb-replicaset.mongodb-replicaset.svc.cluster.local/?replicaSet=rs0"
        - name: SFS_MINIO_ACCESSKEY
          value: "minio"
        ports:
        - containerPort: 8003 
        # resources:
        #   limits:
        #     cpu: "0.5"
        #     memory: "512Mi"
        #   requests:
        #     cpu: "0.25"
        #     memory: "64Mi"
      # restartPolicy: Always
      # imagePullSecrets:
      # - name: regcred-3614
      - name: ng-libs
        image: gitlab.sccloud.ru:5555/sc/ng-libs/master/build:3620
        command: ["nginx"]
        args: ["-g", "daemon off;"]
        env:
        # - name: SFS_SERVER_PORT
        #   value: 8002
        # - name: SFS_MINIO_DELETE_BUCKET
        #   value: "test"
        - name: SFS_MINIO_ENDPOINT
          value: "singing-donkey-minio.minio.svc.cluster.local"
        ports:
        - containerPort: 80
        volumeMounts:
        - name: nginx-conf
          mountPath: /etc/nginx/conf.d
          readOnly: true
      volumes:
      - name: nginx-conf
        configMap:
          name: nginx-conf # place ConfigMap `nginx-conf` on /etc/nginx
          items:
            - key: default.conf
              path: default.conf
            - key: vhost.conf
              path: vhost.conf          
        # resources:
        #   limits:
        #     cpu: "0.5"
        #     memory: "512Mi"
        #   requests:
        #     cpu: "0.25"
        #     memory: "64Mi"
      restartPolicy: Always
      imagePullSecrets:
      - name: regcred-3614
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: nginx-conf
data:
  default.conf: |
    server {
        listen       80;
        server_name  localhost;

        root /app;
        index index.html;
        #charset koi8-r;
        #access_log  /var/log/nginx/host.access.log  main;

            location / {
              try_files $uri $uri/ /index.html;
            }

            location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|mp4|ogg|ogv|webm|htc)$ {
                access_log off;
                access_log off;
                log_not_found off;
            }

            location ~* \.(?:css|js)$ {
                access_log off;
                log_not_found off;
            }


            location /websocket {
                    proxy_pass http://pdev.sccloud.ru:8000/websocket;
                    proxy_http_version 1.1;
                    proxy_set_header Upgrade $http_upgrade;
                    proxy_set_header Connection "upgrade";
                    }

            location /rest/ {
                    if ($request_method = 'OPTIONS') {
                        add_header 'Access-Control-Allow-Origin' '*';
                        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
                        add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
                        add_header 'Access-Control-Max-Age' 1728000;
                        add_header 'Content-Type' 'text/plain; charset=utf-8';
                        add_header 'Content-Length' 0;
                        return 204;
                     }
                    if ($request_method = 'POST') {
                        add_header 'Access-Control-Allow-Origin' '*';
                        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
                        add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
                        add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
                     }
                    if ($request_method = 'GET') {
                        add_header 'Access-Control-Allow-Origin' '*';
                        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
                        add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
                        add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
                     }
                    proxy_pass http://pdev.sccloud.ru:8000/rest/;
                    add_header Access-Control-Allow-Origin *;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_set_header Host $http_host;
                    }

            # location /highcharts/ {
            #         add_header Access-Control-Allow-Origin *;
            #         proxy_pass http://highcharts:8080/;
            #         proxy_set_header   Host $host;
            #         }

            location /aclib/ {
                    add_header Access-Control-Allow-Origin *;
                    proxy_pass http://127.0.0.1:8003/;
                    proxy_http_version 1.1;
                    proxy_set_header Upgrade $http_upgrade;
                    proxy_set_header Connection "upgrade";
                    }

            location /aclib {
                    add_header Access-Control-Allow-Origin *;
                    proxy_pass http://127.0.0.1:8003/;
                    proxy_http_version 1.1;
                    proxy_set_header Upgrade $http_upgrade;
                    proxy_set_header Connection "upgrade";
                    }
                    
            location = /favicon.ico {
                    root /images;
                }

            error_page 500 502 503 504 /502.html;
            location = /502.html {
                    root /pages;
                    internal;
            }
            error_page 404 /404.html;
            location = /404.html {
                    root /pages;
                    internal;
            }
          }

  vhost.conf: |
    server {
        listen       80;
        server_name  review-abstract-c-jgibj2.acl.svc.cluster.local;

        root /app;
        index index.html;
        #charset koi8-r;
        #access_log  /var/log/nginx/host.access.log  main;

            location / {
              try_files $uri $uri/ /index.html;
            }

            location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|mp4|ogg|ogv|webm|htc)$ {
                access_log off;
                access_log off;
                log_not_found off;
            }

            location ~* \.(?:css|js)$ {
                access_log off;
                log_not_found off;
            }


            location /websocket {
                    proxy_pass http://pdev.sccloud.ru:8000/websocket;
                    proxy_http_version 1.1;
                    proxy_set_header Upgrade $http_upgrade;
                    proxy_set_header Connection "upgrade";
                    }

            location /rest/ {
                    if ($request_method = 'OPTIONS') {
                        add_header 'Access-Control-Allow-Origin' '*';
                        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
                        add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
                        add_header 'Access-Control-Max-Age' 1728000;
                        add_header 'Content-Type' 'text/plain; charset=utf-8';
                        add_header 'Content-Length' 0;
                        return 204;
                     }
                    if ($request_method = 'POST') {
                        add_header 'Access-Control-Allow-Origin' '*';
                        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
                        add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
                        add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
                     }
                    if ($request_method = 'GET') {
                        add_header 'Access-Control-Allow-Origin' '*';
                        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
                        add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
                        add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
                     }
                    proxy_pass http://pdev.sccloud.ru:8000/rest/;
                    add_header Access-Control-Allow-Origin *;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_set_header Host $http_host;
                    }

            # location /highcharts/ {
            #         add_header Access-Control-Allow-Origin *;
            #         proxy_pass http://highcharts:8080/;
            #         proxy_set_header   Host $host;
            #         }

            location /aclib/ {
                    add_header Access-Control-Allow-Origin *;
                    #proxy_pass http://review-abstract-c-jgibj2.acl.svc.cluster.local:8003/;
                    proxy_pass http://127.0.0.1:8003/;
                    proxy_http_version 1.1;
                    proxy_set_header Upgrade $http_upgrade;
                    proxy_set_header Connection "upgrade";
                    }
 
            location /aclib {
                    add_header Access-Control-Allow-Origin *;
                    proxy_pass http://127.0.0.1:8003/;
                    proxy_http_version 1.1;
                    proxy_set_header Upgrade $http_upgrade;
                    proxy_set_header Connection "upgrade";
                    }
                    
            location = /favicon.ico {
                    root /images;
                }

            error_page 500 502 503 504 /502.html;
            location = /502.html {
                    root /pages;
                    internal;
            }
            error_page 404 /404.html;
            location = /404.html {
                    root /pages;
                    internal;
            }
          }

Raw Text