2 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
3 .. http://creativecommons.org/licenses/by/4.0
9 Openstack Heat Installation - Policy VM/Docker Recipes
10 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13 :caption: Get the latest images in an already setup policy VM
16 /opt/policy_vm_init.sh
20 :caption: Install/start docker policy containers with no policies preloaded
23 echo "PRELOAD_POLICIES=false" > /opt/policy/.env
24 /opt/policy_vm_init.sh
28 :caption: Install/start docker policy containers with policies preloaded
31 # This is the current default mode of instantiation.
32 # These operations are unnecessary unless PRELOAD_POLICIES
33 # was previously set to true
35 echo "PRELOAD_POLICIES=true" > /opt/policy/.env
36 /opt/policy_vm_init.sh
40 :caption: Access the PDP-D container as the policy user
43 docker exec -it drools bash
47 :caption: Access the PDP-X container as the policy user
50 docker exec -it -u 0 pdp su - policy
54 :caption: Access the BRMSGW container as the policy user
57 docker exec -it -u 0 brmsgw su - policy
61 :caption: Access PAP container as the policy user
64 docker exec -it -u 0 pap su - policy
68 :caption: Access the CONSOLE container the a policy user
71 docker exec -it -u 0 console su - policy
75 :caption: Command line Healthcheck invokation
78 source /opt/app/policy/config/feature-healthcheck.conf.environment
79 curl --silent --user "${HEALTHCHECK_USER}:${HEALTHCHECK_PASSWORD}"
80 -X GET https://localhost:6969/healthcheck | python -m json.tool
83 OOM Installation - Policy Kubernetes Recipes
84 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
87 :caption: List the policy pods
90 kubectl get pods -n onap -o wide | grep policy
94 :caption: Access the PAP container
97 kubectl exec -it <pap-pod> -c pap -n onap -- bash --login
101 :caption: Access a PDPD-D container
104 # <policy-deployment-prefix> depends on the deployment configuration
106 kubectl exec -it <policy-deployment-prefix>-drools-0 -c drools -n onap bash
110 :caption: Access the PDP container
113 # <policy-deployment-prefix> depends on the deployment configuration
115 kubectl exec -it <policy-deployment-prefix>-pdp-0 -c pdp -n onap -- bash --login
119 :caption: Push Default Policies
122 kubectl exec -it <pap-pod> -c pap -n onap -- bash -c "export PRELOAD_POLICIES=true; /tmp/policy-install/config/push-policies.sh"
126 :caption: Standalone Policy Web UI URL access
129 http://<pap-vm>:30219/onap/login.htm
132 PDP-D Recipes (inside the "drools" container)
133 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
136 :caption: Stop the PDP-D
143 :caption: Start the PDP-D
150 :caption: Manual Healthcheck Invokation
153 source ${POLICY_HOME}/config/feature-healthcheck.conf
154 curl --silent --user "${HEALTHCHECK_USER}:${HEALTHCHECK_PASSWORD}"
155 -X GET https://localhost:6969/healthcheck | python -m json.tool
159 :caption: Start a telemetry shell
166 :caption: See all the configured loggers
169 curl -k --silent --user "${ENGINE_MANAGEMENT_USER}:${ENGINE_MANAGEMENT_PASSWORD}"
170 https://localhost:9696/policy/pdp/engine/tools/loggers
174 :caption: See the logging level for a given logger (for example the network logger):
177 curl -k --silent --user"${ENGINE_MANAGEMENT_USER}:${ENGINE_MANAGEMENT_PASSWORD}"
178 https://localhost:9696/policy/pdp/engine/tools/loggers/network
182 :caption: Modify the logging level for a given logger (for example the network logger):
185 curl -k --silent --user"${ENGINE_MANAGEMENT_USER}:${ENGINE_MANAGEMENT_PASSWORD}"
186 -X PUT https://localhost:9696/policy/pdp/engine/tools/loggers/network/WARN
189 PAP Recipes (inside the "pap" container)
190 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
193 :caption: Bypass Portal Authentication with the Policy Web UI
196 sed -i "s/^role_access_centralized.*$/#role_access_centralized=remote/g" /opt/app/policy/servers/console/webapps/onap/WEB-INF/classes/portal.properties
197 cd /opt/app/policy/servers/pap
198 /opt/app/policy/etc/init.d/pap stop; /opt/app/policy/etc/init.d/pap start
203 :caption: Access the Policy Web UI without going through the Portal UI
206 https://policy.api.simpledemo.onap.org:30219/onap/policy (Kubernetes)
211 .. SSNote: Wiki page ref. https://wiki.onap.org/display/DW/Policy+Cookbook