--- /dev/null
+<!--
+ Copyright 2020 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.
+-->
+# Charmed OSM
+
+
+Charmed OSM is an OSM distribution, developed and maintained by Canonical, which uses Juju charms to simplify its deployments and operations. Charmed OSM enables TSPs to easily deploy pure upstream OSM in highly available, production-grade and scalable clusters.
+
+- Industry‐aligned and fully compliant with upstream
+- Predictable release cadence and upgrade path
+- Simplified deployments and operations
+- Stable and secure
+- Highly Available and resilient against failures
+- Supported with [Ubuntu Advantage](https://ubuntu.com/advantage)
+- Availability of managed services
+
+
+## Quick start
+
+Go to the [OSM User Guide](https://osm.etsi.org/docs/user-guide/03-installing-osm.html#charmed-installation)
ng-ui:
charm: "%(prefix)s/ng-ui%(suffix)s"
channel: "%(channel)s"
- scale: 1
+ scale: 3
series: kubernetes
options:
port: 80
annotations:
gui-x: -250
gui-y: 550
- pla-k8s:
+ pla:
charm: "%(prefix)s/pla%(suffix)s"
channel: "%(channel)s"
scale: 3
- "kafka-k8s:kafka"
- - "pla:mongo"
- "mongodb-k8s:mongo"
- - - "pla:mysql"
- - "mariadb-k8s:mysql"
- - 'ng-ui:nbi'
- 'nbi-k8s:nbi'
--- /dev/null
+<!--
+ Copyright 2020 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.
+-->
+# Charmed OSM
+
+
+Charmed OSM is an OSM distribution, developed and maintained by Canonical, which uses Juju charms to simplify its deployments and operations. Charmed OSM enables TSPs to easily deploy pure upstream OSM in highly available, production-grade and scalable clusters.
+
+- Industry‐aligned and fully compliant with upstream
+- Predictable release cadence and upgrade path
+- Simplified deployments and operations
+- Stable and secure
+- Highly Available and resilient against failures
+- Supported with [Ubuntu Advantage](https://ubuntu.com/advantage)
+- Availability of managed services
+
+
+## Quick start
+
+Go to the [OSM User Guide](https://osm.etsi.org/docs/user-guide/03-installing-osm.html#charmed-installation)
- "kafka-k8s:kafka"
- - "pla:mongo"
- "mongodb-k8s:mongo"
- - - "pla:mysql"
- - "mariadb-k8s:mysql"
- - 'ng-ui:nbi'
- 'nbi-k8s:nbi'
interface: kafka
mongo:
interface: mongodb
- mysql:
- interface: mysql
\ No newline at end of file
self.state.set_default(kafka_host=None)
self.state.set_default(kafka_port=None)
self.state.set_default(mongodb_uri=None)
- self.state.set_default(mysql_host=None)
- self.state.set_default(mysql_port=None)
# Observe Charm related events
self.framework.observe(self.on.config_changed, self.on_config_changed)
self.framework.observe(
self.on.mongo_relation_changed, self.on_mongo_relation_changed
)
- self.framework.observe(
- self.on.mysql_relation_changed, self.on_mysql_relation_changed
- )
def _apply_spec(self):
# Only apply the spec if this unit is a leader.
if not self.state.mongodb_uri:
unit.status = WaitingStatus("Waiting for MongoDB")
return
- if not self.state.mysql_host or not self.state.mysql_port:
- unit.status = WaitingStatus("Waiting for MySQL")
- return
unit.status = MaintenanceStatus("Applying new pod spec")
def make_pod_spec(self):
config = self.framework.model.config
- mysql_uri = "mysql://root:{}@{}:{}/{}".format(
- self.state.mysql_root_password,
- self.state.mysql_host,
- self.state.mysql_port,
- self.state.mysql_database,
- )
ports = [
{"name": "port", "containerPort": config["port"], "protocol": "TCP",},
]
"OSMPLA_DATABASE_DRIVER": "mongo",
"OSMPLA_DATABASE_URI": self.state.mongodb_uri,
"OSMPLA_GLOBAL_LOG_LEVEL": config["log_level"],
- "OSMPLA_SQL_DATABASE_URI": mysql_uri,
"OSMPLA_DATABASE_COMMONKEY": config["database_common_key"],
}
)
self._apply_spec()
- def on_mysql_relation_changed(self, event):
- unit = self.model.unit
- if not unit.is_leader():
- return
- unit_data = event.relation.data[event.unit]
- self.state.mysql_host = unit_data.get("host")
- self.state.mysql_port = unit_data.get("port")
- self.state.mysql_root_password = unit_data.get("root_password")
- self.state.mysql_database = self.model.config["database"]
- self._apply_spec()
-
if __name__ == "__main__":
main(PLACharm)