github.com/verrazzano/verrazzano@v1.7.1/tests/testdata/external-lb/system-external-lb-cm.yaml (about)

     1  # Copyright (c) 2022, Oracle and/or its affiliates.
     2  # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
     3  
     4  apiVersion: v1
     5  kind: ConfigMap
     6  metadata:
     7    name: system-external-lb-cm
     8    namespace: external-lb
     9    labels:
    10      app: system-external-lb
    11  data:
    12    nginx.conf: |
    13      error_log  /var/log/nginx/error.log info;
    14      pid        logs/nginx.pid;
    15  
    16      events {
    17          worker_connections  1024;
    18      }
    19  
    20      stream {
    21          upstream nginx_ingress {
    22             least_conn;
    23  {{.ServerList}}
    24          }
    25  
    26          server {
    27             listen       8777;
    28             proxy_pass nginx_ingress;
    29          }
    30      }
    31    startup.sh: |
    32      #!/bin/bash
    33      startupDir=$(dirname $0)
    34      cd $startupDir
    35      cp $startupDir/nginx.conf /etc/nginx/nginx.conf
    36  
    37      mkdir -p /etc/nginx/logs
    38  
    39      /usr/local/nginx/sbin/nginx -c /etc/nginx/nginx.conf -p /etc/nginx -t
    40      /usr/local/nginx/sbin/nginx -c /etc/nginx/nginx.conf -p /etc/nginx
    41  
    42      while [ $? -ne 0 ]; do
    43        sleep 20
    44        echo "retry nginx startup ..."
    45        /usr/local/nginx/sbin/nginx -c /etc/nginx/nginx.conf -p /etc/nginx
    46      done
    47  
    48      tail -f /var/log/nginx/error.log