summaryrefslogtreecommitdiffstats
path: root/.gitreview
blob: c088dd69b380ea1976e29c4e39e6736ac8e3ba07 (plain)
1
2
3
4
[gerrit]
host=gerrit.onap.org
port=29418
project=doc.git
color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
#!/bin/bash
#
# Copyright 2018 Huawei Technologies Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#

if [ "$#" -ne 1 ]; then
    echo This script generates the HEAT template for X number of k8s VMs
    echo "$0 <num k8s vms>"
    exit 1
fi
NUM_K8S_VMS=$1

if [ -z "$WORKSPACE" ]; then
    export WORKSPACE=`git rev-parse --show-toplevel`
fi
PARTS_DIR=$WORKSPACE/deployment/heat/onap-rke/parts

cat <<EOF
#
# Generated by scripts/gen-onap-oom-yaml.sh; MANUAL CHANGES WILL BE LOST
#
EOF

cat $PARTS_DIR/onap-oom-1.yaml

cat <<EOF
  rancher_vm:
    type: OS::Nova::Server
    properties:
      name:
        list_join: ['-', [{ get_param: 'OS::stack_name' }, 'rancher']]
      image: { get_param: ubuntu_1804_image }
      flavor: { get_param: rancher_vm_flavor }
      key_name: { get_param: key_name }
      networks:
      - port: { get_resource: rancher_private_port }
      user_data_format: RAW
      user_data:
        str_replace:
          template:
            get_file: rancher_vm_entrypoint.sh
          params:
            __docker_proxy__: { get_param: docker_proxy }
            __apt_proxy__: { get_param: apt_proxy }
            __rancher_ip_addr__: { get_attr: [rancher_floating_ip, floating_ip_address] }
            __rancher_private_ip_addr__: { get_attr: [rancher_floating_ip, fixed_ip_address] }
            __integration_override_yaml__: { get_param: integration_override_yaml }
            __integration_gerrit_branch__: { get_param: integration_gerrit_branch }
            __integration_gerrit_refspec__: { get_param: integration_gerrit_refspec }
            __oom_gerrit_branch__: { get_param: oom_gerrit_branch }
            __oom_gerrit_refspec__: { get_param: oom_gerrit_refspec }
            __docker_manifest__: { get_param: docker_manifest }
            __docker_version__: { get_param: docker_version }
            __kubectl_version__: { get_param: kubectl_version }
            __helm_version__: { get_param: helm_version }
            __helm_deploy_delay__: { get_param: helm_deploy_delay }
            __use_ramdisk__: { get_param: use_ramdisk }
            __mtu__: { get_param: mtu }
            __portal_hostname__: { get_param: portal_hostname }
            __public_net_id__: { get_param: public_net_id }
            __oam_network_cidr__: { get_param: oam_network_cidr }
            __oam_network_id__: { get_resource: oam_network }
            __oam_subnet_id__: { get_resource: oam_subnet }
            __sec_group__: { get_resource: onap_sg }
            __k8s_01_vm_ip__: { get_attr: [k8s_01_floating_ip, floating_ip_address] }
            __k8s_vm_ips__: [
EOF

for VM_NUM in $(seq -f %02g $NUM_K8S_VMS); do
    K8S_VM_NAME=k8s_$VM_NUM
    cat <<EOF
              get_attr: [${K8S_VM_NAME}_floating_ip, floating_ip_address],
EOF
done

cat <<EOF
            ]
            __k8s_private_ips__: [
EOF

for VM_NUM in $(seq -f %02g $NUM_K8S_VMS); do
    K8S_VM_NAME=k8s_$VM_NUM
    cat <<EOF
              get_attr: [${K8S_VM_NAME}_floating_ip, fixed_ip_address],
EOF
done

cat <<EOF
            ]
EOF

for VM_NUM in $(seq -f %02g $NUM_K8S_VMS); do
    VM_TYPE=k8s HOST_LABEL=compute VM_NUM=$VM_NUM envsubst < $PARTS_DIR/onap-oom-2.yaml
done

for VM_NUM in $(seq 3); do
    VM_TYPE=orch HOST_LABEL=orchestration VM_NUM=$VM_NUM envsubst < $PARTS_DIR/onap-oom-2.yaml
done


cat $PARTS_DIR/onap-oom-3.yaml

for VM_NUM in $(seq -f %02g $NUM_K8S_VMS); do
    K8S_VM_NAME=k8s_$VM_NUM
    cat <<EOF
  ${K8S_VM_NAME}_vm_ip:
    description: The IP address of the ${K8S_VM_NAME} instance
    value: { get_attr: [${K8S_VM_NAME}_floating_ip, floating_ip_address] }

  ${K8S_VM_NAME}_vm_private_ip:
    description: The private IP address of the ${K8S_VM_NAME} instance
    value: { get_attr: [${K8S_VM_NAME}_floating_ip, fixed_ip_address] }

EOF
done

for VM_NUM in $(seq 3); do
    K8S_VM_NAME=orch_$VM_NUM
    cat <<EOF
  ${K8S_VM_NAME}_vm_ip:
    description: The IP address of the ${K8S_VM_NAME} instance
    value: { get_attr: [${K8S_VM_NAME}_floating_ip, floating_ip_address] }

  ${K8S_VM_NAME}_vm_private_ip:
    description: The private IP address of the ${K8S_VM_NAME} instance
    value: { get_attr: [${K8S_VM_NAME}_floating_ip, fixed_ip_address] }

EOF
done