You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

Brian's cheatsheet for Helm commands: K8S / helm basic commands for ONAP integration


#ONAP installation from Windriver jumpserver. Git clone integration repo first, then

ONAP Installation
xuyang11@pod-onap-01-vjhost:~$ cd integration/
xuyang11@pod-onap-01-vjhost:~/src/integration$ source deployment/heat/onap-oom/env/windriver/Integration-SB-05-openrc 
xuyang11@pod-onap-01-vjhost:~/src/integration$ cd deployment/heat/onap-oom
xuyang11@pod-onap-01-vjhost:~/src/integration/deployment/heat/onap-oom$ ./scripts/deploy.sh -m docker-manifest-staging.csv -q env/windriver/onap-oom-light.env


#Update a project configuration. For example GLOBAL_AAI_USERNAME parameter in integration_robot_properties.py

Update a project Chart
root@onap-oom-rancher:~/oom/kubernetes# vi robot/resources/config/eteshare/config/integration_robot_properties.py
root@onap-oom-rancher:~/oom/kubernetes# make robot
root@onap-oom-rancher:~/oom/kubernetes# make onap 
root@onap-oom-rancher:~/oom/kubernetes# helm list -a
root@onap-oom-rancher:~/oom/kubernetes# helm delete dev-robot --purge
root@onap-oom-rancher:~/oom/kubernetes# helm list -a |grep robot
root@onap-oom-rancher:~/oom/kubernetes# helm deploy dev local/onap -f /root/integration-override.yaml --namespace onap
root@onap-oom-rancher:~/oom/kubernetes# kubectl -n onap get pod |grep robot
dev-robot-robot-6f5b8b968f-7gwz9 1/1 Running 0 32s


#List all pods

List pods
root@onap-oom-rancher:~# kubectl -n onap get pods -o wide
NAME                                                    READY     STATUS              RESTARTS   AGE       IP              NODE
dep-config-binding-service-6f68756fb8-h572p             2/2       Running             0          7h        10.42.223.154   onap-oom-k8s-5
dev-aaf-cm-5455cfd7c8-lzkpm                             0/1       Init:1/2            0          9h        10.42.151.249   onap-oom-k8s-3
dev-aaf-cs-7586975b98-fvgrf                             0/1       ContainerCreating   0          9h        <none>          onap-oom-k8s-1


#Check container log. First find containers in the pod

logs
root@onap-oom-rancher:~# kubectl -n onap get pods dev-aai-cassandra-0 -o jsonpath={.spec.containers[*].name}
aai-cassandra
root@onap-oom-rancher:~# kubectl -n onap logs dev-aai-cassandra-0 aai-cassandra


#Restart a pod by deleting it and let Helm to restart one automatically

Restart pod by deleting it
root@onap-oom-rancher:~/oom/kubernetes/onap/charts# kubectl -n onap delete pod dev-portal-portal-cassandra-7b4dbd599b-vhl54
root@onap-oom-rancher:~/oom/kubernetes/onap/charts#


#Enter pod shell

Shell
root@onap-oom-rancher:~# kubectl -n onap exec -it dev-aai-cassandra-0 /bin/bash
root@dev-aai-cassandra-0:/# 


#Access ONAP portal. Get portal-app service private ip first, then go to Openstack Horizon to find public ip and update /etc/hosts with the public ip

Portal Access
# Get portal-app service private ip 
root@oom-rancher:~# kubectl -n onap get services |grep "portal-app"
portal-app  LoadBalancer   10.43.138.237   10.0.0.10   8989:30215/TCP,8006:30213/TCP,8010:30214/TCP 16h
# Get public ip associated with the above private ip from Openstack
xuyang11@pod-onap-01-vjhost:~/Integration-SB-05$ source Integration-SB-05-openrc.sh 
xuyang11@pod-onap-01-vjhost:~/Integration-SB-05$ openstack server list  |grep 10.0.0.10
| b3ecfaac-4654-4b9f-ae33-41b296356384 | oom-k8s_1   | ACTIVE | oam_network_miiM=10.0.0.10, 10.12.5.78 | ubuntu-16-04-cloud-amd64 |
# Update your local /etc/hosts
Yangs-MacBook-Air:Downloads yang$ cat /etc/hosts
10.12.5.78 portal.api.simpledemo.onap.org
10.12.5.78 vid.api.simpledemo.onap.org
10.12.5.78 sdc.api.fe.simpledemo.onap.org
10.12.5.78 portal-sdk.simpledemo.onap.org
10.12.5.78 policy.api.simpledemo.onap.org
10.12.5.78 aai.api.sparky.simpledemo.onap.org
10.12.5.78 cli.api.simpledemo.onap.org
10.12.5.78 msb.api.discovery.simpledemo.onap.org
# Use browser to access ONAP portal url http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/login.htm


#Copy files to and from a pod

Copy
root@oom-rancher:~/oom/kubernetes/robot# kubectl -n onap cp values.yaml dev-robot-598bcc6695-4fsh7: 
root@oom-rancher:~/oom/kubernetes/robot# kubectl -n onap cp dev-robot-598bcc6695-4fsh7:values.yaml /tmp/values.yaml


#Execute a command remotely

root@oom-rancher:~/oom/kubernetes/robot# kubectl -n onap exec dev-robot-598bcc6695-4fsh7 -- ls -l
total 76
drwxr-xr-x   2 root root 4096 May 31 21:15 bin
drwxr-xr-x   2 root root 4096 Apr 24 08:34 boot


#ONAP Healthcheck from Rancher VM

Health
root@oom-rancher:~# cd oom/kubernetes/robot/
root@oom-rancher:~/oom/kubernetes/robot# ./ete-k8s.sh onap health


#Get the pod configMap

root@oom-rancher:~# kubectl -n onap get configMap dev-so-so-sdc-controller-app-configmap -o yaml
apiVersion: v1
data:
override.yaml: |
# Copyright © 2018 AT&T USA
#
# 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.
aai:
auth: 2630606608347B7124C244AB0FE34F6F
server:
port: 8085
spring:
security:
usercredentials:
-
username: asdc
password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
role: Asdc-Client
-
username: mso_admin
password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
role: ACTUATOR
mso:
msoKey: 07a7159d3bf51a0e53be7a8f89699be7
logPath: ./logs/sdc
catalog:
db:
spring:
endpoint: http://so-catalog-db-adapter.onap:8082
db:
auth: Basic YnBlbDpwYXNzd29yZDEk
site-name: onapheat
aai:
endpoint: https://aai.onap:8443
asdc-connections:
asdc-controller1:
user: mso
consumerGroup: sdc-OpenSource-Env1
consumerId: sdc-COpenSource-Env11
environmentName: AUTO
asdcAddress: sdc-be.onap:8443
password: 613AF3483E695524F9857643B697FA51C7A9A0951094F53791485BF3458F9EADA37DBACCCEBD0CB242B85B4062745247
pollingInterval: 60
pollingTimeout: 60
relevantArtifactTypes: HEAT,HEAT_ENV,HEAT_VOL
activateServerTLSAuth: false
keyStorePassword:
keyStorePath:
watchDogTimeout: 300
isFitlerInEmptyResources: true
... ...



  • No labels