david garcia (canonical) - osm-download.etsi.org

37
Introduction to Juju Relations David Garcia (Canonical)

Upload: others

Post on 07-Jul-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: David Garcia (Canonical) - osm-download.etsi.org

Introduction to Juju RelationsDavid Garcia (Canonical)

Page 2: David Garcia (Canonical) - osm-download.etsi.org

Index

1. Performance monitor overview2. Basics of Juju relations3. Add node exporter to squid4. Descriptors and onboarding to OSM5. Deployment6. Execute actions7. Validation

Page 3: David Garcia (Canonical) - osm-download.etsi.org

Performance monitor overview

Page 4: David Garcia (Canonical) - osm-download.etsi.org

Kubernetes

Performance Monitor

4

Node Exporter

Virtual Desktop

This is a KNF with relations

Page 5: David Garcia (Canonical) - osm-download.etsi.org

Focus of this session

5

Node Exporter

Virtual Desktop

Page 6: David Garcia (Canonical) - osm-download.etsi.org

Basics of Juju relations

Page 7: David Garcia (Canonical) - osm-download.etsi.org

7

OSM orchestrates Network Functions

Physical Virtual Container

Page 8: David Garcia (Canonical) - osm-download.etsi.org

8

Understand the challenge of integration

Page 9: David Garcia (Canonical) - osm-download.etsi.org

9

The integrations is done at the operator level

Page 10: David Garcia (Canonical) - osm-download.etsi.org

10

Relations are integration between operators

Page 11: David Garcia (Canonical) - osm-download.etsi.org

11

Operator CharmInstall scripts

Upgrade scriptsCustom action scripts

Scaling scriptsConfiguration scripts

Operator CharmInstall scripts

Upgrade scriptsCustom action scripts

Scaling scriptsConfiguration scripts

Provides database

Requires database

Page 12: David Garcia (Canonical) - osm-download.etsi.org

12

Operator CharmInstall scripts

Upgrade scriptsCustom action scripts

Scaling scriptsConfiguration scripts

Operator CharmInstall scripts

Upgrade scriptsCustom action scripts

Scaling scriptsConfiguration scripts

Matching endpoints can be related

Typed endpoints

Page 13: David Garcia (Canonical) - osm-download.etsi.org

13

Operator CharmInstall scripts

Upgrade scriptsCustom action scripts

Scaling scriptsConfiguration scripts

…Integration scripts

Operator CharmInstall scripts

Upgrade scriptsCustom action scripts

Scaling scriptsConfiguration scripts

…Integration scripts

Page 14: David Garcia (Canonical) - osm-download.etsi.org

Endpoint

An endpoint is used to connect to another application’s endpoint in order to form a relation.

14

- Requires: The endpoint can make use of services represented by another charm’s endpoint. These can be optional.

- Provides: Represents a service that another charm can make use of over a given interface

- Peers: only used between units of the same application

Endpoint

Operator Charm

Page 15: David Garcia (Canonical) - osm-download.etsi.org

Relation: Provides-requires

15

Application: mysql Application: wordpress

mysql/0 wordpress/0

Page 16: David Garcia (Canonical) - osm-download.etsi.org

Relation: Peer

16

Application: mysql

mysql/0

mysql/1 mysql/2

Page 17: David Garcia (Canonical) - osm-download.etsi.org

Interfaces

Is the communication protocol used over a relation between applications (i.e. http)

17

- Interfaces express which data must be exchanged in the relation

- Only endpoints with the same interface can be related

Operator CharmOperator CharmIP: 10.1.1.3 -

Port: 80 -

http interface

Page 18: David Garcia (Canonical) - osm-download.etsi.org

HaproxyOperator charm

apache2 Operator charm

Mysql Operator charm

WordpressOperator charm

mysql

http

http

http http

mysql

18

Page 19: David Garcia (Canonical) - osm-download.etsi.org

Operator charm

Operator charm Operator charm

Reality is messy and mixed

19

KubernetesVIMRacks

PNF PNF

Operator charm

VNF VNF

LXD Operators K8s Operators

VNF KNF

Page 20: David Garcia (Canonical) - osm-download.etsi.org

Charms are universal operators

Page 21: David Garcia (Canonical) - osm-download.etsi.org

Add node exporter to squid

Page 22: David Garcia (Canonical) - osm-download.etsi.org

Kubernetes Pod

My pod

Container 2Container 1

Page 23: David Garcia (Canonical) - osm-download.etsi.org

Kubernetes Pod

My pod

Node Exporter

Page 24: David Garcia (Canonical) - osm-download.etsi.org

Descriptors and onboarding to OSM

Page 25: David Garcia (Canonical) - osm-download.etsi.org

Referencing the juju-bundle (VNFd)

vnfd: [...] kdu: - name: squid-metrics-kdu juju-bundle: bundle.yaml

Page 26: David Garcia (Canonical) - osm-download.etsi.org

juju-bundles/bundle.yaml (VNFd)

bundle: kubernetesapplications: grafana:

charm: ../charms/grafana-operatorscale: 1

prometheus:charm: ../charms/prometheus-operatorscale: 1

squid:charm: ../charms/squid-operatorscale: 1

relations:- - prometheus:grafana-source - grafana:grafana-source- - squid:prometheus-target - prometheus:target

Page 27: David Garcia (Canonical) - osm-download.etsi.org

Adding day-2 operations (VNFd)

vnfd: description: K8s container deployment of Squid Web Proxy df: - id: default-df lcm-operations-configuration: operate-vnf-op-config: day1-2: - id: squid-metrics-kdu config-primitive: - name: addurl parameter: - name: application-name data-type: STRING default-value: squid - name: url data-type: STRING default-value: '' [...]

Page 28: David Garcia (Canonical) - osm-download.etsi.org

Adding day-2 operations (VNFd)

vnfd: description: K8s container deployment of Squid Web Proxy df: - id: default-df lcm-operations-configuration: operate-vnf-op-config: day1-2: - id: squid-metrics-kdu config-primitive: [...] - name: deleteurl parameter: - name: application-name data-type: STRING default-value: squid - name: url data-type: STRING default-value: ''

Page 29: David Garcia (Canonical) - osm-download.etsi.org

Onboarding to OSM

$ cp -R ~/Hackfest/HD2.6-Juju-relations ~/HD2.5-CNF-Juju

$ cd ~/HD2.5-CNF-Juju

$ osm upload-package hackfest_squid_metrics_cnf.tar.gz

$ osm upload-package hackfest_squid_metrics_cnf_ns.tar.gz

Page 30: David Garcia (Canonical) - osm-download.etsi.org

Deployment

Page 31: David Garcia (Canonical) - osm-download.etsi.org

Create Network Service

$ osm ns-create --ns_name webproxy-metrics \ --nsd_name squid_metrics_cnf_ns \ --vim_account $OSM_USER \ --config '{ vld: [{ name: mgmtnet, vim-network-name: osm-ext }] }'

Page 32: David Garcia (Canonical) - osm-download.etsi.org

Check Network Service State

$ watch osm ns-list # Wait until it is in ready state

Page 33: David Garcia (Canonical) - osm-download.etsi.org

Execute actions

Page 34: David Garcia (Canonical) - osm-download.etsi.org

Execute addurl action

$ osm ns-action --action_name addurl \ --vnf_name squid_metrics_cnf \ --kdu_name squid-metrics-kdu \ --params '{url: osm.etsi.org}' \ webproxy-metrics

Page 35: David Garcia (Canonical) - osm-download.etsi.org

Validation

Page 36: David Garcia (Canonical) - osm-download.etsi.org

Validation steps

$ osm vnf-list --filter squid_metrics_cnf

$ osm vnf-show <id> --kdu squid-metrics-kdu

$ osm vnf-show <id> # Get the loadbalancer ip

$ kubectl -n <ns-id> get svc # Get the loadbalancer ip

$ https_proxy=<squid-ip>:3128 curl https://google.com # Error 403

$ https_proxy=<squid-ip>:3128 curl https://osm.etsi.org

Page 37: David Garcia (Canonical) - osm-download.etsi.org

Any questions?