LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD...

32

Transcript of LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD...

Page 1: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database
Page 2: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database

LXD Operators K8s Operators

Page 3: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database
Page 4: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database
Page 5: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database
Page 6: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database
Page 7: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database
Page 8: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database
Page 9: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database
Page 10: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database

“I can send my logs to a syslog”

“I can use a MySQL database”

“I can use LDAP”

Page 11: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database

“I can provide LDAP”

“I can use LDAP”

Page 12: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database
Page 13: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database
Page 14: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database
Page 15: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database

••••••

Page 16: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database

Charm

Page 17: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database

addurl: description: "Add squid config" params: url: description: "URL that will be allowed" type: string default: ""deleteurl: description: "Delete allowed URL squid config" params: url: description: "URL that will stop to be allowed" type: string default: ""

Page 18: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database

#!/bin/bash

URL=`action-get url`

if ! grep -Fxq "http_access allow allowedurls" /etc/squid/squid.confthen sed -i '/^# And finally deny all .*/i http_access allow allowedurls\n' /etc/squid/squid.conffi

sed -i "/^http_access allow allowedurls.*/i acl allowedurls dstdomain \.$URL" /etc/squid/squid.conf

kill -HUP `cat /var/run/squid.pid`

Page 19: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database

def on_deleteurl_action(self, event): """Handle the deleteurl action.""" url = event.params["url"]

line_to_delete = "acl allowedurls dstdomain .{}".format(url) line_deleted = False

with open("/etc/squid/squid.conf", "r") as f: lines = f.readlines() with open("/etc/squid/squid.conf", "w") as f: for line in lines: if line_to_delete not in line: f.write(line) else: line_deleted = True

if line_deleted: event.set_results({"output": "URL deleted succesfully"}) subprocess.check_output( "kill -HUP `cat /var/run/squid.pid`", shell=True) else: event.fail("No URL was deleted")

Page 20: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database
Page 21: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database
Page 22: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database
Page 23: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database

Machine

Juju Controller Juju agent

Juju client

Charm

Application model

Page 24: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database

Juju ControllerJuju client

Page 25: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database

Juju client

Juju Controller

ModelK8s cloud

Model VIM cloud

Page 26: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database
Page 27: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database
Page 28: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database

Charmhttps_proxy: xxxca_cert: yyyy...

Page 29: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database

Charm

Page 30: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database
Page 31: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database

LXD Operators K8s Operators

Page 32: LXD Operatorsosm-download.etsi.org/ftp/osm-7.0-seven/OSM9-hackfest... · 2020-06-01 · LXD Operators K8s Operators “I can send my logs to a syslog” “I can use a MySQL database