08d1aae312
Provide external access to the pod deployed using kubelet hook. http://<floating_ip>:8080 Change-Id: I9506d5114dfa3e3e956f377002d114999d8692de
96 lines
2.2 KiB
YAML
96 lines
2.2 KiB
YAML
heat_template_version: 2014-10-16
|
|
parameters:
|
|
key_name:
|
|
type: string
|
|
default: heat_key
|
|
flavor:
|
|
type: string
|
|
default: m1.small
|
|
image:
|
|
type: string
|
|
default: fedora-software-config
|
|
private_net:
|
|
type: string
|
|
default: private
|
|
public_net:
|
|
type: string
|
|
default: public
|
|
|
|
resources:
|
|
the_sg:
|
|
type: OS::Neutron::SecurityGroup
|
|
properties:
|
|
name: the_sg
|
|
description: Ping and SSH
|
|
rules:
|
|
- protocol: icmp
|
|
- protocol: tcp
|
|
port_range_min: 22
|
|
port_range_max: 22
|
|
- protocol: tcp
|
|
port_range_min: 8080
|
|
port_range_max: 8080
|
|
|
|
kubelet_config:
|
|
type: OS::Heat::StructuredConfig
|
|
properties:
|
|
group: kubelet
|
|
options:
|
|
images_timeout: 600
|
|
containers_timeout: 120
|
|
poll_period: 10
|
|
config:
|
|
version: v1beta2
|
|
containers:
|
|
- name: simple-echo
|
|
image: busybox
|
|
command: ['nc', '-p', '8080', '-l', '-l', '-e', 'echo', 'hello world!']
|
|
ports:
|
|
- name: nc-echo
|
|
hostPort: 8080
|
|
containerPort: 8080
|
|
|
|
kubelet_deployment:
|
|
type: OS::Heat::SoftwareDeployment
|
|
properties:
|
|
name: kubelet_deployment
|
|
config:
|
|
get_resource: kubelet_config
|
|
server:
|
|
get_resource: server
|
|
|
|
server:
|
|
type: OS::Nova::Server
|
|
properties:
|
|
image: {get_param: image}
|
|
flavor: {get_param: flavor}
|
|
key_name: {get_param: key_name}
|
|
security_groups:
|
|
- {get_resource: the_sg}
|
|
user_data_format: SOFTWARE_CONFIG
|
|
|
|
server_floating_ip_assoc:
|
|
type: OS::Neutron::FloatingIPAssociation
|
|
properties:
|
|
floatingip_id: {get_resource: floating_ip}
|
|
port_id: {get_attr: [server, addresses, {get_param: private_net}, 0, port]}
|
|
|
|
floating_ip:
|
|
type: OS::Neutron::FloatingIP
|
|
properties:
|
|
floating_network: {get_param: public_net}
|
|
|
|
outputs:
|
|
status_code_deployment:
|
|
value:
|
|
get_attr: [kubelet_deployment, deploy_status_code]
|
|
stdout:
|
|
value:
|
|
get_attr: [kubelet_deployment, deploy_stdout]
|
|
stderr:
|
|
value:
|
|
get_attr: [kubelet_deployment, deploy_stderr]
|
|
server_floating_ip:
|
|
value:
|
|
get_attr: [floating_ip, floating_ip_address]
|