bundle: kubernetes
applications:
zookeeper:
- charm: "cs:~charmed-osm/zookeeper-0"
+ charm: "cs:~charmed-osm/zookeeper-1"
channel: "stable"
scale: 3
series: kubernetes
gui-x: -300
gui-y: -250
kafka:
- charm: "cs:~charmed-osm/kafka-0"
+ charm: "cs:~charmed-osm/kafka-1"
channel: "stable"
scale: 3
series: kubernetes
gui-x: 0
gui-y: 0
nbi:
- charm: "cs:~charmed-osm/nbi-17"
+ charm: "cs:~charmed-osm/nbi-18"
scale: 3
series: kubernetes
options:
gui-x: 0
gui-y: -250
ro:
- charm: "cs:~charmed-osm/ro-9"
+ charm: "cs:~charmed-osm/ro-10"
scale: 3
series: kubernetes
options:
gui-x: -300
gui-y: 250
ng-ui:
- charm: "cs:~charmed-osm/ng-ui-24"
+ charm: "cs:~charmed-osm/ng-ui-25"
scale: 3
series: kubernetes
annotations:
gui-x: 600
gui-y: 0
lcm:
- charm: "cs:~charmed-osm/lcm-14"
+ charm: "cs:~charmed-osm/lcm-15"
scale: 3
series: kubernetes
options:
gui-x: -300
gui-y: 0
mon:
- charm: "cs:~charmed-osm/mon-11"
+ charm: "cs:~charmed-osm/mon-12"
scale: 1
series: kubernetes
options:
gui-x: 300
gui-y: 0
pol:
- charm: "cs:~charmed-osm/pol-9"
+ charm: "cs:~charmed-osm/pol-10"
scale: 3
series: kubernetes
options:
gui-x: -300
gui-y: 500
pla:
- charm: "cs:~charmed-osm/pla-12"
+ charm: "cs:~charmed-osm/pla-13"
scale: 3
series: kubernetes
options:
gui-x: 600
gui-y: -250
prometheus:
- charm: "cs:~charmed-osm/prometheus-8"
+ charm: "cs:~charmed-osm/prometheus-9"
scale: 1
series: kubernetes
storage:
gui-x: 300
gui-y: 250
grafana:
- charm: "cs:~charmed-osm/grafana-9"
+ charm: "cs:~charmed-osm/grafana-10"
scale: 3
series: kubernetes
annotations:
gui-x: 300
gui-y: 500
keystone:
- charm: "cs:~charmed-osm/keystone-15"
+ charm: "cs:~charmed-osm/keystone-16"
scale: 1
series: kubernetes
annotations:
bundle: kubernetes
applications:
zookeeper:
- charm: "cs:~charmed-osm/zookeeper-0"
+ charm: "cs:~charmed-osm/zookeeper-1"
scale: 1
series: kubernetes
storage:
gui-x: -300
gui-y: -250
kafka:
- charm: "cs:~charmed-osm/kafka-0"
+ charm: "cs:~charmed-osm/kafka-1"
scale: 1
series: kubernetes
storage:
gui-x: 0
gui-y: 0
nbi:
- charm: "cs:~charmed-osm/nbi-17"
+ charm: "cs:~charmed-osm/nbi-18"
scale: 1
series: kubernetes
options:
gui-x: 0
gui-y: -250
ro:
- charm: "cs:~charmed-osm/ro-9"
+ charm: "cs:~charmed-osm/ro-10"
scale: 1
series: kubernetes
options:
gui-x: -300
gui-y: 250
ng-ui:
- charm: "cs:~charmed-osm/ng-ui-24"
+ charm: "cs:~charmed-osm/ng-ui-25"
scale: 1
series: kubernetes
annotations:
gui-x: 600
gui-y: 0
lcm:
- charm: "cs:~charmed-osm/lcm-14"
+ charm: "cs:~charmed-osm/lcm-15"
scale: 1
series: kubernetes
options:
gui-x: -300
gui-y: 0
mon:
- charm: "cs:~charmed-osm/mon-11"
+ charm: "cs:~charmed-osm/mon-12"
scale: 1
series: kubernetes
options:
gui-x: 300
gui-y: 0
pol:
- charm: "cs:~charmed-osm/pol-9"
+ charm: "cs:~charmed-osm/pol-10"
scale: 1
series: kubernetes
options:
gui-x: -300
gui-y: 500
pla:
- charm: "cs:~charmed-osm/pla-12"
+ charm: "cs:~charmed-osm/pla-13"
scale: 1
series: kubernetes
options:
gui-x: 600
gui-y: -250
prometheus:
- charm: "cs:~charmed-osm/prometheus-8"
+ charm: "cs:~charmed-osm/prometheus-9"
scale: 1
series: kubernetes
storage:
gui-x: 300
gui-y: 250
grafana:
- charm: "cs:~charmed-osm/grafana-9"
+ charm: "cs:~charmed-osm/grafana-10"
scale: 1
series: kubernetes
annotations:
gui-x: 300
gui-y: 500
keystone:
- charm: "cs:~charmed-osm/keystone-15"
+ charm: "cs:~charmed-osm/keystone-16"
scale: 1
series: kubernetes
annotations:
description: |
Public SSH key that will be injected to the application pod.
type: string
+ debug_lcm_local_path:
+ description: |
+ Local full path to the LCM project.
+
+ The path will be mounted to the docker image,
+ which means changes during the debugging will be saved in your local path.
+ type: string
+ debug_n2vc_local_path:
+ description: |
+ Local full path to the N2VC project.
+
+ The path will be mounted to the docker image,
+ which means changes during the debugging will be saved in your local path.
+ type: string
+ debug_common_local_path:
+ description: |
+ Local full path to the COMMON project.
+
+ The path will be mounted to the docker image,
+ which means changes during the debugging will be saved in your local path.
+ type: string
security_context:
description: Enables the security context of the pods
type: boolean
super().__init__(
*args,
oci_image="image",
- debug_mode_config_key="debug_mode",
- debug_pubkey_config_key="debug_pubkey",
vscode_workspace=VSCODE_WORKSPACE,
)
+ if self.config.get("debug_mode"):
+ self.enable_debug_mode(
+ pubkey=self.config.get("debug_pubkey"),
+ hostpaths={
+ "LCM": {
+ "hostpath": self.config.get("debug_lcm_local_path"),
+ "container-path": "/usr/lib/python3/dist-packages/osm_lcm",
+ },
+ "N2VC": {
+ "hostpath": self.config.get("debug_n2vc_local_path"),
+ "container-path": "/usr/lib/python3/dist-packages/n2vc",
+ },
+ "osm_common": {
+ "hostpath": self.config.get("debug_common_local_path"),
+ "container-path": "/usr/lib/python3/dist-packages/osm_common",
+ },
+ },
+ )
self.kafka_client = KafkaClient(self, "kafka")
self.framework.observe(self.on["kafka"].relation_changed, self.configure_pod)
self.framework.observe(self.on["kafka"].relation_broken, self.configure_pod)
description: |
Public SSH key that will be injected to the application pod.
type: string
+ debug_mon_local_path:
+ description: |
+ Local full path to the MON project.
+
+ The path will be mounted to the docker image,
+ which means changes during the debugging will be saved in your local path.
+ type: string
+ debug_n2vc_local_path:
+ description: |
+ Local full path to the N2VC project.
+
+ The path will be mounted to the docker image,
+ which means changes during the debugging will be saved in your local path.
+ type: string
+ debug_common_local_path:
+ description: |
+ Local full path to the COMMON project.
+
+ The path will be mounted to the docker image,
+ which means changes during the debugging will be saved in your local path.
+ type: string
security_context:
description: Enables the security context of the pods
type: boolean
super().__init__(
*args,
oci_image="image",
- debug_mode_config_key="debug_mode",
- debug_pubkey_config_key="debug_pubkey",
vscode_workspace=VSCODE_WORKSPACE,
)
-
+ if self.config.get("debug_mode"):
+ self.enable_debug_mode(
+ pubkey=self.config.get("debug_pubkey"),
+ hostpaths={
+ "MON": {
+ "hostpath": self.config.get("debug_mon_local_path"),
+ "container-path": "/usr/lib/python3/dist-packages/osm_mon",
+ },
+ "N2VC": {
+ "hostpath": self.config.get("debug_n2vc_local_path"),
+ "container-path": "/usr/lib/python3/dist-packages/n2vc",
+ },
+ "osm_common": {
+ "hostpath": self.config.get("debug_common_local_path"),
+ "container-path": "/usr/lib/python3/dist-packages/osm_common",
+ },
+ },
+ )
self.kafka_client = KafkaClient(self, "kafka")
self.framework.observe(self.on["kafka"].relation_changed, self.configure_pod)
self.framework.observe(self.on["kafka"].relation_broken, self.configure_pod)
description: |
Public SSH key that will be injected to the application pod.
type: string
+ debug_nbi_local_path:
+ description: |
+ Local full path to the NBI project.
+
+ The path will be mounted to the docker image,
+ which means changes during the debugging will be saved in your local path.
+ type: string
+ debug_common_local_path:
+ description: |
+ Local full path to the COMMON project.
+
+ The path will be mounted to the docker image,
+ which means changes during the debugging will be saved in your local path.
+ type: string
security_context:
description: Enables the security context of the pods
type: boolean
super().__init__(
*args,
oci_image="image",
- debug_mode_config_key="debug_mode",
- debug_pubkey_config_key="debug_pubkey",
vscode_workspace=VSCODE_WORKSPACE,
)
+ if self.config.get("debug_mode"):
+ self.enable_debug_mode(
+ pubkey=self.config.get("debug_pubkey"),
+ hostpaths={
+ "NBI": {
+ "hostpath": self.config.get("debug_nbi_local_path"),
+ "container-path": "/usr/lib/python3/dist-packages/osm_nbi",
+ },
+ "osm_common": {
+ "hostpath": self.config.get("debug_common_local_path"),
+ "container-path": "/usr/lib/python3/dist-packages/osm_common",
+ },
+ },
+ )
self.kafka_client = KafkaClient(self, "kafka")
self.framework.observe(self.on["kafka"].relation_changed, self.configure_pod)
description: |
Public SSH key that will be injected to the application pod.
type: string
+ debug_pol_local_path:
+ description: |
+ Local full path to the POL project.
+
+ The path will be mounted to the docker image,
+ which means changes during the debugging will be saved in your local path.
+ type: string
+ debug_common_local_path:
+ description: |
+ Local full path to the COMMON project.
+
+ The path will be mounted to the docker image,
+ which means changes during the debugging will be saved in your local path.
+ type: string
security_context:
description: Enables the security context of the pods
type: boolean
super().__init__(
*args,
oci_image="image",
- debug_mode_config_key="debug_mode",
- debug_pubkey_config_key="debug_pubkey",
vscode_workspace=VSCODE_WORKSPACE,
)
-
+ if self.config.get("debug_mode"):
+ self.enable_debug_mode(
+ pubkey=self.config.get("debug_pubkey"),
+ hostpaths={
+ "POL": {
+ "hostpath": self.config.get("debug_pol_local_path"),
+ "container-path": "/usr/lib/python3/dist-packages/osm_policy_module",
+ },
+ "osm_common": {
+ "hostpath": self.config.get("debug_common_local_path"),
+ "container-path": "/usr/lib/python3/dist-packages/osm_common",
+ },
+ },
+ )
self.kafka_client = KafkaClient(self, "kafka")
self.framework.observe(self.on["kafka"].relation_changed, self.configure_pod)
self.framework.observe(self.on["kafka"].relation_broken, self.configure_pod)
description: |
Public SSH key that will be injected to the application pod.
type: string
+ debug_ro_local_path:
+ description: |
+ Local full path to the RO project.
+
+ The path will be mounted to the docker image,
+ which means changes during the debugging will be saved in your local path.
+ type: string
+ debug_common_local_path:
+ description: |
+ Local full path to the COMMON project.
+
+ The path will be mounted to the docker image,
+ which means changes during the debugging will be saved in your local path.
+ type: string
security_context:
description: Enables the security context of the pods
type: boolean
import base64
import logging
-from typing import NoReturn, Optional
+from typing import Dict, NoReturn, Optional
from ops.main import main
from opslib.osm.charm import CharmedOsmBase, RelationsMissing
super().__init__(
*args,
oci_image="image",
- debug_mode_config_key="debug_mode",
- debug_pubkey_config_key="debug_pubkey",
vscode_workspace=VSCODE_WORKSPACE,
)
-
+ if self.config.get("debug_mode"):
+ self.enable_debug_mode(
+ pubkey=self.config.get("debug_pubkey"),
+ hostpaths={
+ "osm_common": {
+ "hostpath": self.config.get("debug_common_local_path"),
+ "container-path": "/usr/lib/python3/dist-packages/osm_common",
+ },
+ **_get_ro_host_paths(self.config.get("debug_ro_local_path")),
+ },
+ )
self.kafka_client = KafkaClient(self, "kafka")
self.framework.observe(self.on["kafka"].relation_changed, self.configure_pod)
self.framework.observe(self.on["kafka"].relation_broken, self.configure_pod)
"settings": {},
}
+
+def _get_ro_host_paths(ro_host_path: str) -> Dict:
+ """Get RO host paths"""
+ return (
+ {
+ "NG-RO": {
+ "hostpath": f"{ro_host_path}/NG-RO",
+ "container-path": "/usr/lib/python3/dist-packages/osm_ng_ro",
+ },
+ "RO-plugin": {
+ "hostpath": f"{ro_host_path}/RO-plugin",
+ "container-path": "/usr/lib/python3/dist-packages/osm_ro_plugin",
+ },
+ "RO-SDN-arista_cloudvision": {
+ "hostpath": f"{ro_host_path}/RO-SDN-arista_cloudvision",
+ "container-path": "/usr/lib/python3/dist-packages/osm_rosdn_arista_cloudvision",
+ },
+ "RO-SDN-dpb": {
+ "hostpath": f"{ro_host_path}/RO-SDN-dpb",
+ "container-path": "/usr/lib/python3/dist-packages/osm_rosdn_dpb",
+ },
+ "RO-SDN-dynpac": {
+ "hostpath": f"{ro_host_path}/RO-SDN-dynpac",
+ "container-path": "/usr/lib/python3/dist-packages/osm_rosdn_dynpac",
+ },
+ "RO-SDN-floodlight_openflow": {
+ "hostpath": f"{ro_host_path}/RO-SDN-floodlight_openflow",
+ "container-path": "/usr/lib/python3/dist-packages/osm_rosdn_floodlightof",
+ },
+ "RO-SDN-ietfl2vpn": {
+ "hostpath": f"{ro_host_path}/RO-SDN-ietfl2vpn",
+ "container-path": "/usr/lib/python3/dist-packages/osm_rosdn_ietfl2vpn",
+ },
+ "RO-SDN-juniper_contrail": {
+ "hostpath": f"{ro_host_path}/RO-SDN-juniper_contrail",
+ "container-path": "/usr/lib/python3/dist-packages/osm_rosdn_juniper_contrail",
+ },
+ "RO-SDN-odl_openflow": {
+ "hostpath": f"{ro_host_path}/RO-SDN-odl_openflow",
+ "container-path": "/usr/lib/python3/dist-packages/osm_rosdn_odlof",
+ },
+ "RO-SDN-onos_openflow": {
+ "hostpath": f"{ro_host_path}/RO-SDN-onos_openflow",
+ "container-path": "/usr/lib/python3/dist-packages/osm_rosdn_onosof",
+ },
+ "RO-SDN-onos_vpls": {
+ "hostpath": f"{ro_host_path}/RO-SDN-onos_vpls",
+ "container-path": "/usr/lib/python3/dist-packages/osm_rosdn_onos_vpls",
+ },
+ "RO-VIM-aws": {
+ "hostpath": f"{ro_host_path}/RO-VIM-aws",
+ "container-path": "/usr/lib/python3/dist-packages/osm_rovim_aws",
+ },
+ "RO-VIM-azure": {
+ "hostpath": f"{ro_host_path}/RO-VIM-azure",
+ "container-path": "/usr/lib/python3/dist-packages/osm_rovim_azure",
+ },
+ "RO-VIM-gcp": {
+ "hostpath": f"{ro_host_path}/RO-VIM-gcp",
+ "container-path": "/usr/lib/python3/dist-packages/osm_rovim_gcp",
+ },
+ "RO-VIM-fos": {
+ "hostpath": f"{ro_host_path}/RO-VIM-fos",
+ "container-path": "/usr/lib/python3/dist-packages/osm_rovim_fos",
+ },
+ "RO-VIM-opennebula": {
+ "hostpath": f"{ro_host_path}/RO-VIM-opennebula",
+ "container-path": "/usr/lib/python3/dist-packages/osm_rovim_opennebula",
+ },
+ "RO-VIM-openstack": {
+ "hostpath": f"{ro_host_path}/RO-VIM-openstack",
+ "container-path": "/usr/lib/python3/dist-packages/osm_rovim_openstack",
+ },
+ "RO-VIM-openvim": {
+ "hostpath": f"{ro_host_path}/RO-VIM-openvim",
+ "container-path": "/usr/lib/python3/dist-packages/osm_rovim_openvim",
+ },
+ "RO-VIM-vmware": {
+ "hostpath": f"{ro_host_path}/RO-VIM-vmware",
+ "container-path": "/usr/lib/python3/dist-packages/osm_rovim_vmware",
+ },
+ }
+ if ro_host_path
+ else {}
+ )
+
+
if __name__ == "__main__":
main(RoCharm)
--- /dev/null
+##
+# Copyright 2019 ETSI
+#
+# 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
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+##
+
+charms=`cat bundles/osm/bundle.yaml | grep cs | grep -v k8s | awk '{print $2}' | tr -d \"`
+for charm_uri in $charms; do
+ charm_without_rev=`echo $charm_uri| rev | cut -d "-" -f 2-5 | rev`
+ latest_revision=`charm show --channel edge $charm_without_rev | grep Revision | awk '{print $2}'`
+ new_charm_uri=$charm_without_rev-$latest_revision
+ old_uri=`echo $charm_uri | sed 's/\//\\\\\//g'`
+ new_uri=`echo $new_charm_uri | sed 's/\//\\\\\//g'`
+ sed -i "s/"$old_uri"/"$new_uri"/g" bundles/osm/bundle.yaml
+done
+
+charms=`cat bundles/osm-ha/bundle.yaml | grep cs | grep -v k8s | awk '{print $2}' | tr -d \"`
+for charm_uri in $charms; do
+ charm_without_rev=`echo $charm_uri| rev | cut -d "-" -f 2-5 | rev`
+ latest_revision=`charm show --channel edge $charm_without_rev | grep Revision | awk '{print $2}'`
+ new_charm_uri=$charm_without_rev-$latest_revision
+ old_uri=`echo $charm_uri | sed 's/\//\\\\\//g'`
+ new_uri=`echo $new_charm_uri | sed 's/\//\\\\\//g'`
+ sed -i "s/"$old_uri"/"$new_uri"/g" bundles/osm-ha/bundle.yaml
+done
\ No newline at end of file
- Easily configure modules for debugging_mode: `juju config <module> debug_mode=True debug_pubkey="ssh-rsa ..."`.
- Debug in K8s: All pods (the debugged ones and the rest) will be running always in K8s.
- Seemless setup: VSCode will connect through SSH to the pods.
+- Keep your changes save: Possibility to mount local module to the container; all the changes will be saved automatically to your local filesystem.
## Install OSM
Once the Charmed OSM installation has finished, you can select which applications you want to run with the debug mode.
-- lcm: `juju config lcm debug_mode=True debug_pubkey="ssh-rsa ..."`
-- mon: `juju config mon debug_mode=True debug_pubkey="ssh-rsa ..."`
-- nbi: `juju config nbi debug_mode=True debug_pubkey="ssh-rsa ..."`
-- ro: `juju config ro debug_mode=True debug_pubkey="ssh-rsa ..."`
-- pol: `juju config pol debug_mode=True debug_pubkey="ssh-rsa ..."`
+```bash
+# LCM
+juju config lcm debug_mode=True debug_pubkey="`cat ~/.ssh/id_rsa.pub`"
+# MON
+juju config mon debug_mode=True debug_pubkey="`cat ~/.ssh/id_rsa.pub`"
+# NBI
+juju config nbi debug_mode=True debug_pubkey="`cat ~/.ssh/id_rsa.pub`"
+# RO
+juju config ro debug_mode=True debug_pubkey="`cat ~/.ssh/id_rsa.pub`"
+# POL
+juju config pol debug_mode=True debug_pubkey="`cat ~/.ssh/id_rsa.pub`"
+```
Enabling the debug_mode will put a `sleep infinity` as the entrypoint of the container. That way, we can later connect to the pod through SSH in VSCode, and run the entrypoint of the application from the debugger.
-### Prepare pods
+### Mounting local modules
+
+The Charmed OSM Debugging mode allows you to mount local modules to the desired charms. The following commands show which modules can be mounted in each charm.
+
+```bash
+LCM_LOCAL_PATH="/path/to/LCM"
+N2VC_LOCAL_PATH="/path/to/N2VC"
+NBI_LOCAL_PATH="/path/to/NBI"
+RO_LOCAL_PATH="/path/to/RO"
+MON_LOCAL_PATH="/path/to/MON"
+POL_LOCAL_PATH="/path/to/POL"
+COMMON_LOCAL_PATH="/path/to/common"
+
+# LCM
+juju config lcm debug_lcm_local_path=$LCM_LOCAL_PATH
+juju config lcm debug_n2vc_local_path=$N2VC_LOCAL_PATH
+juju config lcm debug_common_local_path=$COMMON_LOCAL_PATH
+# MON
+juju config mon debug_mon_local_path=$MON_LOCAL_PATH
+juju config mon debug_n2vc_local_path=$N2VC_LOCAL_PATH
+juju config mon debug_common_local_path=$COMMON_LOCAL_PATH
+# NBI
+juju config nbi debug_nbi_local_path=$LCM_LOCAL_PATH
+juju config nbi debug_common_local_path=$COMMON_LOCAL_PATH
+# RO
+juju config ro debug_ro_local_path=$RO_LOCAL_PATH
+juju config ro debug_common_local_path=$COMMON_LOCAL_PATH
+# POL
+juju config pol debug_pol_local_path=$POL_LOCAL_PATH
+juju config pol debug_common_local_path=$COMMON_LOCAL_PATH
+```
-Preparing the pods includes setting up the ~/.ssh/config so the VSCode can easily discover which ssh hosts are available
+### Generate SSH config file
+
+Preparing the pods includes setting up the `~/.ssh/config` so the VSCode can easily discover which ssh hosts are available
Just execute:
```bash
-./prepare_pods.sh
+./generate_ssh_config.sh
```
-> NOTE: The public key that will be used will be `$HOME/.ssh/id_rsa.pub`. If you want to use a different one, add the absolute path to it as a first argument: `./prepare_pods.sh /path/to/key.pub`.
+> NOTE: The public key that will be used will be `$HOME/.ssh/id_rsa.pub`. If you want to use a different one, add the absolute path to it as a first argument: `./generate_ssh_config.sh /path/to/key.pub`.
### Connect to Pods
### Add workspace
-The `./prepare_pods.sh` script adds a workspace to the `/root` folder of each pod, with the following name: `<module>.code-workspace`.
+The `./generate_ssh_config.sh` script adds a workspace to the `/root` folder of each pod, with the following name: `debug.code-workspace`.
-In the window of the connected host, go to `File/Open Workspace...`. Then select the `<module>.code-workspace` file.
+In the window of the connected host, go to `File/Open Workspace from File...`. Then select the `debug.code-workspace` file.
### Run and Debug
-Go to extensions and install the Python extension. It will be installed in the remote pod.
-
-Now we need to add a [debug configuration](https://code.visualstudio.com/docs/editor/debugging). For that, go to the Run and Debug tab, and click on `create a launch.json file`.
+Open the `Terminal` tab, and the Python extension will be automatically downloaded. It will be installed in the remote pod.
-Now you will be asked to select a folder in your workspace. Select the folder of the main component:
+Go to the `Explorer (ctrl + shift + E)` to see the module folders in the charm. You can add breakpoints and start debugging.
-- LCM: select osm_lcm
-- MON: select osm_mon
-- NBI: select osm_nbi
-- RO: select osm_ng_ro
-- POL: select osm_policy_module
+Go to the `Run and Debug (ctrl + shift + D)` and press `F5` to start the main entrypoint of the charm.
-Then select `Python` as the environment. And finally, select `Module` and enter the module of the component you are going to test (LCM example: osm_lcm.lcm)
+Happy debugging!
--- /dev/null
+#!/bin/bash
+# Copyright 2021 Canonical 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
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact: legal@canonical.com
+#
+# To get in touch with the maintainers, please contact:
+# osm-charmers@lists.launchpad.net
+##
+
+MODULES="lcm pol mon ro nbi"
+
+
+PUBLIC_KEY=${1:-$HOME/.ssh/id_rsa.pub}
+echo "Using $PUBLIC_KEY key."
+[ -f $PUBLIC_KEY ] || (echo "$PUBLIC_KEY file does not exist" && exit 1)
+PUBLIC_KEY_CONTENT=`cat $PUBLIC_KEY`
+
+mkdir -p ~/.ssh/config.d
+echo "" | tee ~/.ssh/config.d/osm
+
+
+for module in $MODULES; do
+ if [[ `juju config -m osm $module debug_mode` == "true" ]]; then
+ pod_name=`microk8s.kubectl -n osm get pods | grep -E "^$module-" | grep -v operator | cut -d " " -f 1`
+ pod_ip=`microk8s.kubectl -n osm get pods $pod_name -o yaml | yq e .status.podIP -`
+ echo "Host $module
+ HostName $pod_ip
+ User root
+ # StrictHostKeyChecking no
+ IdentityFile $PUBLIC_KEY" | tee -a ~/.ssh/config.d/osm
+ fi
+done
+
+
+import_osm_config="Include config.d/osm"
+touch ~/.ssh/config
+grep "$import_osm_config" ~/.ssh/config || ( echo -e "$import_osm_config\n$(cat ~/.ssh/config)" > ~/.ssh/config )
\ No newline at end of file
+++ /dev/null
-#!/bin/bash
-# Copyright 2021 Canonical 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
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-#
-# For those usages not covered by the Apache License, Version 2.0 please
-# contact: legal@canonical.com
-#
-# To get in touch with the maintainers, please contact:
-# osm-charmers@lists.launchpad.net
-##
-
-MODULES="lcm pol mon ro nbi"
-
-
-PUBLIC_KEY=${1:-$HOME/.ssh/id_rsa.pub}
-echo "Using $PUBLIC_KEY key."
-[ -f $PUBLIC_KEY ] || (echo "$PUBLIC_KEY file does not exist" && exit 1)
-PUBLIC_KEY_CONTENT=`cat $PUBLIC_KEY`
-
-mkdir -p ~/.ssh/config.d
-echo "" | tee ~/.ssh/config.d/osm
-
-
-for module in $MODULES; do
- if [[ `juju config -m osm $module debug_mode` == "true" ]]; then
- pod_name=`microk8s.kubectl -n osm get pods | grep -E "^$module-" | grep -v operator | cut -d " " -f 1`
- pod_ip=`microk8s.kubectl -n osm get pods $pod_name -o yaml | yq e .status.podIP -`
- echo "Host $module
- HostName $pod_ip
- User root
- # StrictHostKeyChecking no
- IdentityFile $PUBLIC_KEY" | tee -a ~/.ssh/config.d/osm
- fi
-done
-
-
-import_osm_config="Include config.d/osm"
-touch ~/.ssh/config
-grep "$import_osm_config" ~/.ssh/config || ( echo -e "$import_osm_config\n$(cat ~/.ssh/config)" > ~/.ssh/config )
\ No newline at end of file