Commit 9720ee6e authored by calvinosanc1's avatar calvinosanc1
Browse files

Packages prepared for the hackfest 15 challenge - remove EE


Signed-off-by: calvinosanc1's avatarGuillermo Calvino <guillermo.calvino@canonical.com>
parent 6ea22557
Pipeline #10874 failed with stage
in 1 minute and 20 seconds
nsd:
nsd:
- description: NS with 2 VNFs with cloudinit connected by datanet and mgmtnet VLs
df:
- id: default-df
vnf-profile:
- id: vnf1
virtual-link-connectivity:
- constituent-cpd-id:
- constituent-base-element-id: vnf1
constituent-cpd-id: vnf-mgmt-ext
virtual-link-profile-id: mgmtnet
- constituent-cpd-id:
- constituent-base-element-id: vnf1
constituent-cpd-id: vnf-data-ext
virtual-link-profile-id: datanet
vnfd-id: k8s_proxy_charm_day1_only-vnf
- id: vnf2
virtual-link-connectivity:
- constituent-cpd-id:
- constituent-base-element-id: vnf2
constituent-cpd-id: vnf-mgmt-ext
virtual-link-profile-id: mgmtnet
- constituent-cpd-id:
- constituent-base-element-id: vnf2
constituent-cpd-id: vnf-data-ext
virtual-link-profile-id: datanet
vnfd-id: k8s_proxy_charm-vnf
id: k8s_proxy_charm_day1_and_day2-ns
name: k8s_proxy_charm_day1_and_day2-ns
version: 1.0
virtual-link-desc:
- id: mgmtnet
mgmt-network: true
- id: datanet
vnfd-id:
- k8s_proxy_charm_day1_only-vnf
- k8s_proxy_charm-vnf
nsd:
nsd:
- description: NS with 2 VNFs with cloudinit connected by datanet and mgmtnet VLs
df:
- id: default-df
vnf-profile:
- id: vnf1
virtual-link-connectivity:
- constituent-cpd-id:
- constituent-base-element-id: vnf1
constituent-cpd-id: vnf-mgmt-ext
virtual-link-profile-id: mgmtnet
- constituent-cpd-id:
- constituent-base-element-id: vnf1
constituent-cpd-id: vnf-data-ext
virtual-link-profile-id: datanet
vnfd-id: k8s_proxy_charm_day1_only-vnf
- id: vnf2
virtual-link-connectivity:
- constituent-cpd-id:
- constituent-base-element-id: vnf2
constituent-cpd-id: vnf-mgmt-ext
virtual-link-profile-id: mgmtnet
- constituent-cpd-id:
- constituent-base-element-id: vnf2
constituent-cpd-id: vnf-data-ext
virtual-link-profile-id: datanet
vnfd-id: k8s_proxy_charm_day1_only-vnf
id: k8s_proxy_charm_day1_only-ns
name: k8s_proxy_charm_day1_only-ns
version: 1.0
virtual-link-desc:
- id: mgmtnet
mgmt-network: true
- id: datanet
vnfd-id:
- k8s_proxy_charm_day1_only-vnf
##
# Copyright 2020 Canonical Ltd.
# All rights reserved.
#
# 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.
##
touch:
description: "Touch a file on the VNF."
params:
filename:
description: "The name of the file to touch."
type: string
default: ""
required:
- filename
# Standard OSM functions
start:
description: "Stop the service on the VNF."
stop:
description: "Stop the service on the VNF."
restart:
description: "Stop the service on the VNF."
reboot:
description: "Reboot the VNF virtual machine."
upgrade:
description: "Upgrade the software on the VNF."
# Required by charms.osm.sshproxy
run:
description: "Run an arbitrary command"
params:
command:
description: "The command to execute."
type: string
default: ""
required:
- command
generate-ssh-key:
description: "Generate a new SSH keypair for this unit. This will replace any existing previously generated keypair."
verify-ssh-credentials:
description: "Verify that this unit can authenticate with server specified by ssh-hostname and ssh-username."
get-ssh-public-key:
description: "Get the public SSH key for this unit."
##
# Copyright 2020 Canonical Ltd.
# All rights reserved.
#
# 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.
##
options:
ssh-hostname:
type: string
default: ""
description: "The hostname or IP address of the machine to"
ssh-username:
type: string
default: ""
description: "The username to login as."
ssh-password:
type: string
default: ""
description: "The password used to authenticate."
ssh-public-key:
type: string
default: ""
description: "The public key of this unit."
ssh-key-type:
type: string
default: "rsa"
description: "The type of encryption to use for the SSH key."
ssh-key-bits:
type: int
default: 4096
description: "The number of bits to use for the SSH key."
../mod/charms.osm/charms
\ No newline at end of file
../mod/operator/ops
\ No newline at end of file
##
# Copyright 2020 Canonical Ltd.
# All rights reserved.
#
# 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.
##
name: simple-k8s-proxy
summary: A simple example proxy charm
description: |
Simple proxy charm is an example charm used in OSM Hackfests
series:
- kubernetes
peers:
proxypeer:
interface: proxypeer
deployment:
mode: operator
\ No newline at end of file
#!/usr/bin/env python3
##
# Copyright 2020 Canonical Ltd.
# All rights reserved.
#
# 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.
##
import sys
sys.path.append("lib")
from charms.osm.sshproxy import SSHProxyCharm
from ops.main import main
class MySSHProxyCharm(SSHProxyCharm):
def __init__(self, framework, key):
super().__init__(framework, key)
# Listen to charm events
self.framework.observe(self.on.config_changed, self.on_config_changed)
self.framework.observe(self.on.install, self.on_install)
self.framework.observe(self.on.start, self.on_start)
# Listen to the touch action event
self.framework.observe(self.on.touch_action, self.on_touch_action)
def on_config_changed(self, event):
"""Handle changes in configuration"""
super().on_config_changed(event)
def on_install(self, event):
"""Called when the charm is being installed"""
super().on_install(event)
def on_start(self, event):
"""Called when the charm is being started"""
super().on_start(event)
def on_touch_action(self, event):
"""Touch a file."""
if self.model.unit.is_leader():
filename = event.params["filename"]
proxy = self.get_ssh_proxy()
stdout, stderr = proxy.run("touch {}".format(filename))
event.set_results({"output": stdout})
else:
event.fail("Unit is not leader")
return
if __name__ == "__main__":
main(MySSHProxyCharm)
#cloud-config
password: osm4u
chpasswd: { expire: False }
ssh_pwauth: True
write_files:
- content: |
# My new helloworld file
owner: root:root
permissions: '0644'
path: /root/helloworld.txt
vnfd:
description:
A VNF consisting of 1 VDU connected to two external VL, and one for
data and another one for management
df:
- id: default-df
instantiation-level:
- id: default-instantiation-level
vdu-level:
- number-of-instances: 1
vdu-id: mgmtVM
vdu-profile:
- id: mgmtVM
min-number-of-instances: 1
lcm-operations-configuration:
operate-vnf-op-config:
day1-2:
- config-access:
ssh-access:
default-user: ubuntu
required: true
execution-environment-list:
- id: simple-ee
juju:
charm: simple
cloud: k8s
id: k8s_proxy_charm_day1_only-vnf
initial-config-primitive:
- name: config
execution-environment-ref: simple-ee
parameter:
- name: ssh-hostname
value: <rw_mgmt_ip>
- name: ssh-username
value: ubuntu
- name: ssh-password
value: osm4u
seq: 1
- name: touch
execution-environment-ref: simple-ee
parameter:
- data-type: STRING
name: filename
value: /home/ubuntu/first-touch
seq: 2
ext-cpd:
- id: vnf-mgmt-ext
int-cpd:
cpd: mgmtVM-eth0-int
vdu-id: mgmtVM
- id: vnf-data-ext
int-cpd:
cpd: dataVM-xe0-int
vdu-id: mgmtVM
id: k8s_proxy_charm_day1_only-vnf
mgmt-cp: vnf-mgmt-ext
product-name: k8s_proxy_charm_day1_only-vnf
sw-image-desc:
- id: ubuntu18.04
image: ubuntu18.04
name: ubuntu18.04
- id: ubuntu18.04-azure
name: ubuntu18.04-azure
image: Canonical:UbuntuServer:18.04-LTS:latest
vim-type: azure
- id: ubuntu18.04-gcp
name: ubuntu18.04-gcp
image: ubuntu-os-cloud:image-family:ubuntu-1804-lts
vim-type: gcp
vdu:
- cloud-init-file: cloud-config.txt
id: mgmtVM
int-cpd:
- id: mgmtVM-eth0-int
virtual-network-interface-requirement:
- name: mgmtVM-eth0
position: 1
virtual-interface:
type: PARAVIRT
- id: dataVM-xe0-int
virtual-network-interface-requirement:
- name: dataVM-xe0
position: 2
virtual-interface:
type: PARAVIRT
name: mgmtVM
sw-image-desc: ubuntu18.04
alternative-sw-image-desc:
- ubuntu18.04-azure
- ubuntu18.04-gcp
virtual-compute-desc: mgmtVM-compute
virtual-storage-desc:
- mgmtVM-storage
version: 1.0
virtual-compute-desc:
- id: mgmtVM-compute
virtual-cpu:
num-virtual-cpu: 1
virtual-memory:
size: 1.0
virtual-storage-desc:
- id: mgmtVM-storage
size-of-storage: 10
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment