blob: 2f93b00fdb484c8136ecba91d55320cbd26ef61a [file] [log] [blame]
garciadeblascf603f52025-06-04 11:57:28 +02001#!/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
16set -e -o pipefail
17set -x
18
19HERE=$(dirname "$(readlink --canonicalize "$BASH_SOURCE")")
20source "${HERE}/../library/functions.sh"
21source "${HERE}/../library/trap.sh"
22source "${HERE}/../library/logging"
23source "${HERE}/../library/track"
24
25source "${HERE}/00-default-install-options.rc"
26[ ! -f "${OSM_HOME_DIR}/user-install-options.rc" ] || source "${OSM_HOME_DIR}/user-install-options.rc"
27source "${CREDENTIALS_DIR}/osm_environment.rc"
28
29KUBECONFIG_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}
34osm --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}'
41osm --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