| garciadeblas | cf603f5 | 2025-06-04 11:57:28 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 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 | |
| 16 | set -e -o pipefail |
| 17 | set -x |
| 18 | |
| 19 | HERE=$(dirname "$(readlink --canonicalize "$BASH_SOURCE")") |
| 20 | source "${HERE}/../library/functions.sh" |
| 21 | source "${HERE}/../library/trap.sh" |
| 22 | source "${HERE}/../library/logging" |
| 23 | source "${HERE}/../library/track" |
| 24 | |
| 25 | source "${HERE}/00-default-install-options.rc" |
| 26 | [ ! -f "${OSM_HOME_DIR}/user-install-options.rc" ] || source "${OSM_HOME_DIR}/user-install-options.rc" |
| 27 | source "${CREDENTIALS_DIR}/osm_environment.rc" |
| 28 | |
| 29 | KUBECONFIG_OSM_CLUSTER_FILE="${OSM_HOME_DIR}/clusters/kubeconfig-osm.yaml" |
| 30 | |
| 31 | [ -n "${OSM_HOSTNAME}" ] || FATAL "OSM_HOSTNAME is not set" "${OSM_HOSTNAME}" \ |
| 32 | "Please set the OSM_HOSTNAME environment variable to the hostname of your OSM instance." |
| 33 | [ "$(which osm)" = "$HOME/.local/bin/osm" ] || export PATH=$HOME/.local/bin:${PATH} |
| 34 | osm --hostname ${OSM_HOSTNAME} --all-projects vim-create \ |
| 35 | --name _system-osm-vim \ |
| 36 | --account_type dummy \ |
| 37 | --auth_url http://dummy \ |
| 38 | --user osm --password osm --tenant osm \ |
| 39 | --description "dummy" \ |
| 40 | --config '{management_network_name: mgmt}' |
| 41 | osm --hostname ${OSM_HOSTNAME} --all-projects k8scluster-add \ |
| 42 | --creds ${KUBECONFIG_OSM_CLUSTER_FILE} \ |
| 43 | --vim _system-osm-vim \ |
| 44 | --k8s-nets '{"net1": null}' \ |
| 45 | --version '1.29' \ |
| 46 | --description "OSM Internal Cluster" \ |
| 47 | _system-osm-k8s |