summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
955e499)
1. Add OS environment to specify the k8s service floating IP that makes the IMS and DMS return the correct endpoint
Signed-off-by: Zhang Rong(Jon) <rong.zhang@windriver.com>
Change-Id: I35f009d3dada3a9f7e0b369637e804a2461e9e6f
image: "{{ .Values.o2ims.image.repository }}:{{ .Values.o2ims.image.tag }}"\r
command: ["/bin/bash", "/opt/o2watcher_start.sh"]\r
env:\r
image: "{{ .Values.o2ims.image.repository }}:{{ .Values.o2ims.image.tag }}"\r
command: ["/bin/bash", "/opt/o2watcher_start.sh"]\r
env:\r
+ - name: API_HOST_EXTERNAL_FLOATING\r
+ value: {{ .Values.ocloud.API_HOST_EXTERNAL_FLOATING }}\r
- name: DB_HOST\r
value: postgres\r
- name: DB_PASSWORD\r
- name: DB_HOST\r
value: postgres\r
- name: DB_PASSWORD\r
OS_USERNAME: ""
OS_PASSWORD: ""
K8S_KUBECONFIG: ""
OS_USERNAME: ""
OS_PASSWORD: ""
K8S_KUBECONFIG: ""
+ API_HOST_EXTERNAL_FLOATING: ""
depends_on:
- redis_pubsub
environment:
depends_on:
- redis_pubsub
environment:
+ - API_HOST_EXTERNAL_FLOATING=${API_HOST_EXTERNAL_FLOATING}
- DB_HOST=postgres
- DB_PASSWORD=o2ims123
- REDIS_HOST=redis
- DB_HOST=postgres
- DB_PASSWORD=o2ims123
- REDIS_HOST=redis
export OS_USERNAME=<INF username e.g.: admin>
export OS_PASSWORD=<INF password for user e.g.: adminpassword>
export OS_USERNAME=<INF username e.g.: admin>
export OS_PASSWORD=<INF password for user e.g.: adminpassword>
+ # If the external OAM IP same as OS_AUTH_URL's IP address, you can use the below command to set the environment
+ # export API_HOST_EXTERNAL_FLOATING=$(echo ${OS_AUTH_URL/$(echo ${OS_AUTH_URL} | grep :// | sed -e's,^\(.*//\).*,\1,g')} | cut -d/ -f1 | sed -e 's,:.*,,g')
+ export API_HOST_EXTERNAL_FLOATING=<INF external_oam_floating_address e.g.: 128.10.10.10>
+
cat <<EOF>o2service-override.yaml
o2ims:
imagePullSecrets: admin-orano2-registry-secret
cat <<EOF>o2service-override.yaml
o2ims:
imagePullSecrets: admin-orano2-registry-secret
OS_USERNAME: "${OS_USERNAME}"
OS_PASSWORD: "${OS_PASSWORD}"
K8S_KUBECONFIG: "/opt/k8s_kube.conf"
OS_USERNAME: "${OS_USERNAME}"
OS_PASSWORD: "${OS_PASSWORD}"
K8S_KUBECONFIG: "/opt/k8s_kube.conf"
+ API_HOST_EXTERNAL_FLOATING: "${API_HOST_EXTERNAL_FLOATING}"
- host = os.environ.get("API_HOST", "localhost")
- port = 5005 if host == "localhost" else 80
+ host_interal = os.environ.get("API_HOST", "localhost")
+ host_external = os.environ.get("API_HOST_EXTERNAL_FLOATING")
+ host = host_interal if host_external is None or host_external == '' \
+ else host_external
+
+ port_internal = 5005 if host == "localhost" else 80
+ port_external = 30205
+ port = port_internal if host_external is None or host_external == '' \
+ else port_external
return f"http://{host}:{port}"
return f"http://{host}:{port}"
def get_o2dms_api_base():
def get_o2dms_api_base():
- return get_root_api_base() + "o2dms"
+ return get_root_api_base() + "o2dms/v1"
def get_redis_host_and_port():
def get_redis_host_and_port():
def create_by(stxobj: StxGenericModel) -> Ocloud:
def create_by(stxobj: StxGenericModel) -> Ocloud:
- imsendpoint = config.get_api_url() + config.get_o2ims_api_base()
+ imsendpoint = config.get_api_url() + config.get_o2ims_api_base() + '/'
globalcloudId = stxobj.id # to be updated
description = "An ocloud"
ocloud = Ocloud(stxobj.id, stxobj.name, imsendpoint,
globalcloudId = stxobj.id # to be updated
description = "An ocloud"
ocloud = Ocloud(stxobj.id, stxobj.name, imsendpoint,