agones.dev/agones@v1.54.0/test/load/allocation/runScenario.sh (about)

     1  # Copyright 2022 Google LLC All Rights Reserved.
     2  #
     3  # Licensed under the Apache License, Version 2.0 (the "License");
     4  # you may not use this file except in compliance with the License.
     5  # You may obtain a copy of the License at
     6  #
     7  #     http://www.apache.org/licenses/LICENSE-2.0
     8  #
     9  # Unless required by applicable law or agreed to in writing, software
    10  # distributed under the License is distributed on an "AS IS" BASIS,
    11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  # See the License for the specific language governing permissions and
    13  # limitations under the License.
    14  
    15  #!/bin/bash
    16  
    17  if [ "$#" -ne 1 ]; then
    18    echo "Must pass exactly one argument"
    19    exit 2
    20  fi
    21  
    22  NAMESPACE=${NAMESPACE:-default}
    23  # extract the required TLS and mTLS files
    24  kubectl get secret allocator-client.default -n ${NAMESPACE} -ojsonpath="{.data.tls\.crt}" | base64 -d > client.crt
    25  kubectl get secret allocator-client.default -n ${NAMESPACE} -ojsonpath="{.data.tls\.key}" | base64 -d > client.key
    26  kubectl get secret allocator-tls-ca -n agones-system -ojsonpath='{.data.tls-ca\.crt}' | base64 -d > ca.crt
    27  
    28  EXTERNAL_IP=$(kubectl get services agones-allocator -n agones-system -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
    29  KEY_FILE=${KEY_FILE:-client.key}
    30  CERT_FILE=${CERT_FILE:-client.crt}
    31  TLS_CA_FILE=${TLS_CA_FILE:-ca.crt}
    32  MULTICLUSTER=${MULTICLUSTER:-false}
    33  
    34  go run runscenario/runscenario.go --ip ${EXTERNAL_IP} --namespace ${NAMESPACE} \
    35    --key ${KEY_FILE} --cert ${CERT_FILE} --cacert ${TLS_CA_FILE} \
    36    --scenariosFile ${1}