Cookiecutter updates
Change-Id: I4027b59c418ac0622a11b54c3d7fa3b309fe8a63
This commit is contained in:
parent
1da4c62eed
commit
d27d31b205
@ -16,9 +16,9 @@ Build a base geneeric charm with the `charmcraft` tool.
|
|||||||
|
|
||||||
.. code:: bash
|
.. code:: bash
|
||||||
|
|
||||||
mkdir charm-ironic-operator
|
mkdir charm-ironic-k8s
|
||||||
cd charm-ironic-operator
|
cd charm-ironic-k8s
|
||||||
charmcraft init --name sunbeam-ironic-operator
|
charmcraft init --author $USER --name ironic-k8s
|
||||||
|
|
||||||
Add ASO common files to new charm. The script will ask a few basic questions:
|
Add ASO common files to new charm. The script will ask a few basic questions:
|
||||||
|
|
||||||
@ -26,11 +26,11 @@ Add ASO common files to new charm. The script will ask a few basic questions:
|
|||||||
|
|
||||||
git clone https://opendev.org/openstack/charm-ops-sunbeam
|
git clone https://opendev.org/openstack/charm-ops-sunbeam
|
||||||
cd charm-ops-sunbeam
|
cd charm-ops-sunbeam
|
||||||
./sunbeam-charm-init.sh ~/branches/charm-ironic-operator
|
./sunbeam-charm-init.sh ~/charm-ironic-k8s
|
||||||
|
|
||||||
This tool is designed to be used after 'charmcraft init' was initially run
|
This tool is designed to be used after 'charmcraft init' was initially run
|
||||||
service_name [ironic]: ironic
|
service_name [ironic]: ironic
|
||||||
charm_name [sunbeam-ironic-operator]: sunbeam-ironic-operator
|
charm_name [ironic-k8s]: ironic-k8s
|
||||||
ingress_port []: 6385
|
ingress_port []: 6385
|
||||||
db_sync_command [] ironic-dbsync --config-file /etc/ironic/ironic.conf create_schema:
|
db_sync_command [] ironic-dbsync --config-file /etc/ironic/ironic.conf create_schema:
|
||||||
|
|
||||||
@ -38,13 +38,15 @@ Fetch interface libs corresponding to the requires interfaces:
|
|||||||
|
|
||||||
.. code:: bash
|
.. code:: bash
|
||||||
|
|
||||||
cd charm-ironic-operator
|
cd charm-ironic-k8s
|
||||||
charmcraft login
|
charmcraft login --export ~/secrets.auth
|
||||||
|
export CHARMCRAFT_AUTH=$(cat ~/secrets.auth)
|
||||||
charmcraft fetch-lib charms.nginx_ingress_integrator.v0.ingress
|
charmcraft fetch-lib charms.nginx_ingress_integrator.v0.ingress
|
||||||
charmcraft fetch-lib charms.data_platform_libs.v0.database_requires
|
charmcraft fetch-lib charms.data_platform_libs.v0.database_requires
|
||||||
charmcraft fetch-lib charms.sunbeam_keystone_operator.v0.identity_service
|
charmcraft fetch-lib charms.keystone_k8s.v1.identity_service
|
||||||
charmcraft fetch-lib charms.sunbeam_rabbitmq_operator.v0.amqp
|
charmcraft fetch-lib charms.rabbitmq_k8s.v0.rabbitmq
|
||||||
charmcraft fetch-lib charms.observability_libs.v1.kubernetes_service_patch
|
charmcraft fetch-lib charms.observability_libs.v1.kubernetes_service_patch
|
||||||
|
charmcraft fetch-lib charms.traefik_k8s.v1.ingress
|
||||||
|
|
||||||
Templates
|
Templates
|
||||||
=========
|
=========
|
||||||
@ -86,7 +88,7 @@ The next step is to pack the charm into a deployable format
|
|||||||
|
|
||||||
.. code:: bash
|
.. code:: bash
|
||||||
|
|
||||||
cd charm-ironic-operator
|
cd charm-ironic-k8s
|
||||||
charmcraft pack
|
charmcraft pack
|
||||||
|
|
||||||
|
|
||||||
@ -98,10 +100,12 @@ run the service. Juju can pull the image directly from dockerhub.
|
|||||||
|
|
||||||
.. code:: bash
|
.. code:: bash
|
||||||
|
|
||||||
juju deploy ./sunbeam-ironic-operator_ubuntu-20.04-amd64.charm --resource ironic-api-image=kolla/ubuntu-binary-ironic-api:wallaby ironic
|
juju deploy ./ironic-k8s_ubuntu-20.04-amd64.charm --resource ironic-api-image=kolla/ubuntu-binary-ironic-api:yoga ironic
|
||||||
juju add-relation ironic mysql
|
juju relate ironic mysql
|
||||||
juju add-relation ironic keystone
|
juju relate ironic keystone
|
||||||
juju add-relation ironic rabbitmq
|
juju relate ironic rabbitmq
|
||||||
|
juju relate ironic:ingress-internal traefik:ingress
|
||||||
|
juju relate ironic:ingress-public traefik:ingress
|
||||||
|
|
||||||
Test Service
|
Test Service
|
||||||
============
|
============
|
||||||
@ -116,7 +120,7 @@ preset. Then check the ironic api service is responding.
|
|||||||
ks micro microk8s/localhost 2.9.22 unsupported 13:31:41Z
|
ks micro microk8s/localhost 2.9.22 unsupported 13:31:41Z
|
||||||
|
|
||||||
App Version Status Scale Charm Store Channel Rev OS Address Message
|
App Version Status Scale Charm Store Channel Rev OS Address Message
|
||||||
ironic active 1 sunbeam-ironic-operator local 0 kubernetes 10.152.183.73
|
ironic active 1 ironic-k8s local 0 kubernetes 10.152.183.73
|
||||||
|
|
||||||
Unit Workload Agent Address Ports Message
|
Unit Workload Agent Address Ports Message
|
||||||
ironic/0* active idle 10.1.155.106
|
ironic/0* active idle 10.1.155.106
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import shutil
|
import shutil
|
||||||
import yaml
|
import yaml
|
||||||
@ -41,6 +41,7 @@ def get_extra_context(charm_dir):
|
|||||||
charm_name = metadata['name']
|
charm_name = metadata['name']
|
||||||
service_name = charm_name.replace('sunbeam-', '')
|
service_name = charm_name.replace('sunbeam-', '')
|
||||||
service_name = service_name.replace('-operator', '')
|
service_name = service_name.replace('-operator', '')
|
||||||
|
service_name = service_name.replace('-k8s', '')
|
||||||
ctxt = {
|
ctxt = {
|
||||||
'service_name': service_name,
|
'service_name': service_name,
|
||||||
'charm_name': charm_name}
|
'charm_name': charm_name}
|
||||||
|
@ -28,8 +28,13 @@ requires:
|
|||||||
limit: 1
|
limit: 1
|
||||||
identity-service:
|
identity-service:
|
||||||
interface: keystone
|
interface: keystone
|
||||||
ingress:
|
ingress-internal:
|
||||||
interface: ingress
|
interface: ingress
|
||||||
|
optional: true
|
||||||
|
limit: 1
|
||||||
|
ingress-public:
|
||||||
|
interface: ingress
|
||||||
|
limit: 1
|
||||||
amqp:
|
amqp:
|
||||||
interface: rabbitmq
|
interface: rabbitmq
|
||||||
|
|
||||||
|
@ -57,11 +57,5 @@ class {{ cookiecutter.service_name[0]|upper}}{{cookiecutter.service_name[1:] }}O
|
|||||||
return {{ cookiecutter.ingress_port }}
|
return {{ cookiecutter.ingress_port }}
|
||||||
|
|
||||||
|
|
||||||
class {{ cookiecutter.service_name[0]|upper}}{{cookiecutter.service_name[1:] }}WallabyOperatorCharm({{ cookiecutter.service_name[0]|upper}}{{cookiecutter.service_name[1:] }}OperatorCharm):
|
|
||||||
|
|
||||||
openstack_release = 'wallaby'
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# Note: use_juju_for_storage=True required per
|
main({{ cookiecutter.service_name[0]|upper}}{{cookiecutter.service_name[1:] }}OperatorCharm)
|
||||||
# https://github.com/canonical/operator/issues/506
|
|
||||||
main({{ cookiecutter.service_name[0]|upper}}{{cookiecutter.service_name[1:] }}WallabyOperatorCharm, use_juju_for_storage=True)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user