Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add helm-deployer role to helm-deployer repo
Partial-Bug: #1749018 Depends-On: I62522ef2a6aef35ffddb03d90762cdb218db8b24 Change-Id: I887a53e66c99fdd4aed2dcd2c893d8b14828be37
- Loading branch information
1 parent
67183c0
commit 8763268
Showing
7 changed files
with
205 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
- project: | ||
name: Juniper/contrail-helm-deployer | ||
check: | ||
jobs: | ||
- zuul-jobs-linters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
deploy_subnet: "192.168.1.0/24" | ||
container_registry: "docker.io/opencontrailnightly" | ||
container_tag: "ocata-master-34" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#!/bin/bash | ||
set -ex | ||
cd ${OSH_PATH} | ||
|
||
#Get physical_intf and ip address | ||
physical_intf="$(sudo ip -4 route list 0/0 | awk '{ print $5; exit }')" | ||
intf_ip_address="$(ip addr show dev $physical_intf | grep "inet .*/.* brd " | awk '{print $2}' | cut -d '/' -f 1)" | ||
|
||
./tools/deployment/developer/common/001-install-packages-opencontrail.sh | ||
./tools/deployment/developer/common/010-deploy-k8s.sh | ||
|
||
#Install openstack and heat client | ||
./tools/deployment/developer/common/020-setup-client.sh | ||
|
||
#Deploy openstack-helm related charts | ||
export OSH_EXTRA_HELM_ARGS_NOVA="--set images.tags.opencontrail_compute_init=${CONTRAIL_REGISTRY}/contrail-openstack-compute-init:${CONTAINER_TAG}" | ||
export OSH_EXTRA_HELM_ARGS_NEUTRON="--set images.tags.opencontrail_neutron_init=${CONTRAIL_REGISTRY}/contrail-openstack-neutron-init:${CONTAINER_TAG}" | ||
|
||
./tools/deployment/developer/nfs/031-ingress-opencontrail.sh | ||
./tools/deployment/developer/nfs/040-nfs-provisioner.sh | ||
./tools/deployment/developer/nfs/050-mariadb.sh | ||
./tools/deployment/developer/nfs/060-rabbitmq.sh | ||
./tools/deployment/developer/nfs/070-memcached.sh | ||
./tools/deployment/developer/nfs/080-keystone.sh | ||
./tools/deployment/developer/nfs/100-horizon.sh | ||
./tools/deployment/developer/nfs/120-glance.sh | ||
./tools/deployment/developer/nfs/151-libvirt-opencontrail.sh | ||
./tools/deployment/developer/nfs/161-compute-kit-opencontrail.sh | ||
|
||
#Now deploy opencontrail charts | ||
cd $CHD_PATH | ||
make | ||
|
||
#Label nodes with contrail specific labels | ||
kubectl label node opencontrail.org/controller=enabled --all | ||
kubectl label node opencontrail.org/vrouter-kernel=enabled --all | ||
|
||
#Give cluster-admin permission for the user to create contrail pods | ||
kubectl replace -f rbac/cluster-admin.yaml | ||
|
||
#Populate the contrail-override-values.yaml file | ||
tee /tmp/contrail.yaml << EOF | ||
global: | ||
images: | ||
tags: | ||
cassandra: "${CONTRAIL_REGISTRY}/contrail-external-cassandra:${CONTAINER_TAG}" | ||
kafka: "${CONTRAIL_REGISTRY}/contrail-external-kafka:${CONTAINER_TAG}" | ||
zookeeper: "${CONTRAIL_REGISTRY}/contrail-external-zookeeper:${CONTAINER_TAG}" | ||
config_api: "${CONTRAIL_REGISTRY}/contrail-controller-config-api:${CONTAINER_TAG}" | ||
config_devicemgr: "${CONTRAIL_REGISTRY}/contrail-controller-config-devicemgr:${CONTAINER_TAG}" | ||
config_schema_transformer: "${CONTRAIL_REGISTRY}/contrail-controller-config-schema:${CONTAINER_TAG}" | ||
config_svcmonitor: "${CONTRAIL_REGISTRY}/contrail-controller-config-svcmonitor:${CONTAINER_TAG}" | ||
contrail_control: "${CONTRAIL_REGISTRY}/contrail-controller-control-control:${CONTAINER_TAG}" | ||
control_dns: "${CONTRAIL_REGISTRY}/contrail-controller-control-dns:${CONTAINER_TAG}" | ||
control_named: "${CONTRAIL_REGISTRY}/contrail-controller-control-named:${CONTAINER_TAG}" | ||
nodemgr: "${CONTRAIL_REGISTRY}/contrail-nodemgr:${CONTAINER_TAG}" | ||
webui_middleware: "${CONTRAIL_REGISTRY}/contrail-controller-webui-job:${CONTAINER_TAG}" | ||
webui: "${CONTRAIL_REGISTRY}/contrail-controller-webui-web:${CONTAINER_TAG}" | ||
analytics_alarm_gen: "${CONTRAIL_REGISTRY}/contrail-analytics-alarm-gen:${CONTAINER_TAG}" | ||
analytics_api: "${CONTRAIL_REGISTRY}/contrail-analytics-api:${CONTAINER_TAG}" | ||
analytics_query_engine: "${CONTRAIL_REGISTRY}/contrail-analytics-query-engine:${CONTAINER_TAG}" | ||
analytics_snmp_collector: "${CONTRAIL_REGISTRY}/contrail-analytics-snmp-collector:${CONTAINER_TAG}" | ||
contrail_collector: "${CONTRAIL_REGISTRY}/contrail-analytics-collector:${CONTAINER_TAG}" | ||
contrail_topology: "${CONTRAIL_REGISTRY}/contrail-analytics-topology:${CONTAINER_TAG}" | ||
build_driver_init: "${CONTRAIL_REGISTRY}/contrail-vrouter-kernel-build-init:${CONTAINER_TAG}" | ||
dpdk_watchdog: "${CONTRAIL_REGISTRY}/contrail-vrouter-net-watchdog:${CONTAINER_TAG}" | ||
vrouter_agent: "${CONTRAIL_REGISTRY}/contrail-vrouter-agent:${CONTAINER_TAG}" | ||
vrouter_init_kernel: "${CONTRAIL_REGISTRY}/contrail-vrouter-kernel-init:${CONTAINER_TAG}" | ||
vrouter_dpdk: "${CONTRAIL_REGISTRY}/contrail-vrouter-agent-dpdk:${CONTAINER_TAG}" | ||
vrouter_init_dpdk: "${CONTRAIL_REGISTRY}/contrail-vrouter-kernel-init-dpdk:${CONTAINER_TAG}" | ||
contrail_env: | ||
CONTROLLER_NODES: $intf_ip_address | ||
LOG_LEVEL: SYS_NOTICE | ||
CLOUD_ORCHESTRATOR: openstack | ||
AAA_MODE: cloud-admin | ||
PHYSICAL_INTERFACE: $physical_intf | ||
EOF | ||
|
||
# Install contrail chart | ||
helm install --name contrail ${CHD_PATH}/contrail \ | ||
--namespace=contrail --values=/tmp/contrail.yaml | ||
|
||
# Deploying heat charts after contrail charts are deployed as they have dependency on contrail charts | ||
cd ${OSH_PATH} | ||
export OSH_EXTRA_HELM_ARGS_HEAT="--set images.tags.opencontrail_heat_init=${CONTRAIL_REGISTRY}/contrail-openstack-heat-init:${CONTAINER_TAG}" | ||
|
||
./tools/deployment/developer/nfs/091-heat-opencontrail.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
- name: Set variables | ||
set_fact: | ||
repos_dir: "{{ ansible_env.HOME }}/src/{{ zuul.project.canonical_hostname }}/Juniper" | ||
contrail_registry: "{{ docker_registry.fqdn }}:{{ docker_registry.port }}" | ||
|
||
- name: copy local vars template to target machine | ||
template: | ||
src: templates/local-vars.yaml.j2 | ||
dest: "{{ repos_dir }}/openstack-helm-infra/tools/gate/devel/local-vars.yaml" | ||
mode: 0644 | ||
|
||
- name: copy deployment script to target machine | ||
copy: | ||
src: helm-deploy.sh | ||
dest: "{{ ansible_env.HOME }}" | ||
mode: 0755 | ||
|
||
- name: run helm deployment script | ||
command: ./helm-deploy.sh | ||
args: | ||
chdir: "{{ ansible_env.HOME }}" | ||
environment: | ||
BASE_DIR: "{{ repos_dir }}" | ||
OSH_PATH: "{{ repos_dir }}/openstack-helm" | ||
OSH_INFRA_PATH: "{{ repos_dir }}/openstack-helm-infra" | ||
CHD_PATH: "{{ repos_dir }}/contrail-helm-deployer" | ||
CONTRAIL_REGISTRY: "{{ contrail_registry }}" | ||
CONTAINER_TAG: "{{ container_tag }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: | ||
kubernetes: v1.8.3 | ||
helm: v2.7.2 | ||
cni: v0.6.0 | ||
|
||
docker: | ||
insecure_registries: | ||
- "{{ docker_registry.fqdn }}:{{ docker_registry.port }}" | ||
|
||
kubernetes: | ||
network: | ||
default_device: {{ ansible_default_ipv4.interface }} | ||
cluster: | ||
cni: calico | ||
pod_subnet: 192.168.0.0/16 | ||
domain: cluster.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# The order of packages is significant, because pip processes them in the order | ||
# of appearance. Changing the order has an impact on the overall integration | ||
# process, which may cause wedges in the gate later. | ||
flake8 | ||
|
||
# We need to pin Ansible to <2.4 until Zuul supports it, otherwise ansible-lint | ||
# picks the latest version which is not known to work yet. | ||
ansible<2.4 | ||
ansible-lint | ||
bashate>=0.2 | ||
zuul-sphinx>=0.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
[tox] | ||
minversion = 1.6 | ||
skipsdist = True | ||
envlist = linters | ||
|
||
[testenv] | ||
basepython = python3 | ||
install_command = pip install {opts} {packages} | ||
deps = -r{toxinidir}/test-requirements.txt | ||
commands = | ||
python setup.py testr --slowest --testr-args='{posargs}' | ||
|
||
[testenv:bindep] | ||
# Do not install any requirements. We want this to be fast and work even if | ||
# system dependencies are missing, since it's used to tell you what system | ||
# dependencies are missing! This also means that bindep must be installed | ||
# separately, outside of the requirements files. | ||
deps = bindep | ||
commands = bindep test | ||
|
||
[testenv:docs] | ||
commands = python setup.py build_sphinx | ||
|
||
[testenv:linters] | ||
passenv = | ||
# NOTE(pabelanger): if you'd like to run tox -elinters locally, you'll need | ||
# to export ANSIBLE_ROLES_PATH pointing to the currect repos. | ||
# see infra-zuul-jobs-linters job for more information. | ||
ANSIBLE_ROLES_PATH | ||
whitelist_externals = bash | ||
commands = | ||
# Ansible lint | ||
# [ANSIBLE0012] Commands should not change things if nothing needs doing | ||
bash -c "echo '* Linting roles'; if test -d roles; then \ | ||
find roles -type f -regex '.*.ya?ml' -print0 | \ | ||
xargs -t -n1 -0 ansible-lint -xANSIBLE0012; fi" | ||
bash -c "echo '* Linting playbooks'; if test -d playbooks; then \ | ||
find playbooks -type f -regex '.*.ya?ml' -print0 | \ | ||
xargs -t -n1 -0 ansible-lint -xANSIBLE0012; fi" | ||
# Ansible Syntax Check | ||
bash -c "echo '* Ansible Syntax Check'; if test -d playbooks; then \ | ||
find playbooks -type f -regex '.*.ya?ml' -exec \ | ||
ansible-playbook --syntax-check -e@{toxinidir}/tests/secrets.yaml \ | ||
-i {toxinidir}/tests/inventory \{\} + > /dev/null; fi" | ||
|
||
[testenv:venv] | ||
commands = {posargs} | ||
|
||
[flake8] | ||
# These are ignored intentionally in openstack-infra projects; | ||
# please don't submit patches that solely correct them or enable them. | ||
# E402 - ansible modules put documentation before imports. Align to ansible. | ||
ignore = E125,E129,E402,H | ||
show-source = True | ||
exclude = .venv,.tox,dist,doc,build,*.egg |