Switch to using prebuilt CCP images
This commit is contained in:
parent
ca8ef29ae4
commit
4d295d567b
4 changed files with 50 additions and 32 deletions
|
@ -27,15 +27,6 @@ git clone https://github.com/adidenko/vagrant-k8s
|
|||
cd vagrant-k8s
|
||||
```
|
||||
|
||||
* If you want to run OpenStack CCP (Containerised Control Plane) then you need
|
||||
to pull CCP repos and patches:
|
||||
|
||||
```bash
|
||||
pushd ccp
|
||||
./ccp-pull.sh
|
||||
popd
|
||||
```
|
||||
|
||||
* Prepare the virtual lab:
|
||||
|
||||
```bash
|
||||
|
|
|
@ -19,6 +19,24 @@ skip_empty = True
|
|||
EOF
|
||||
}
|
||||
|
||||
create_mirantis_mcp_conf() {
|
||||
echo "Create mcp config"
|
||||
cat > /root/mcp.conf << EOF
|
||||
[builder]
|
||||
push = False
|
||||
|
||||
[registry]
|
||||
address = "registry01-bud.ng.mirantis.net:5800"
|
||||
insecure = True
|
||||
|
||||
[kubernetes]
|
||||
environment = "openstack"
|
||||
|
||||
[repositories]
|
||||
skip_empty = True
|
||||
EOF
|
||||
}
|
||||
|
||||
create_resolvconf() {
|
||||
DNS_IP=`kubectl get service/kubedns --namespace=kube-system --template={{.spec.clusterIP}}`
|
||||
cat > /root/resolv.conf << EOF
|
||||
|
@ -61,8 +79,9 @@ hack_images() {
|
|||
done
|
||||
}
|
||||
|
||||
create_mcp_conf
|
||||
# Switch to using prebuild images from ccp team
|
||||
#create_mcp_conf
|
||||
create_mirantis_mcp_conf
|
||||
create_registry
|
||||
create_resolvconf
|
||||
#hack_images
|
||||
build_images
|
||||
#create_resolvconf
|
||||
#build_images
|
||||
|
|
|
@ -14,9 +14,12 @@ nodes=( \
|
|||
)
|
||||
|
||||
create_network_conf() {
|
||||
if [ -f /root/cluster-topology.yaml ] ; then
|
||||
echo "/root/cluster-topology.yaml already exists"
|
||||
else
|
||||
kubectl get nodes -o go-template='{{range .items}}{{range .status.addresses}}{{if or (eq .type "ExternalIP") (eq .type "LegacyHostIP")}}{{.address}}{{print "\n"}}{{end}}{{end}}{{end}}'> /tmp/nodes
|
||||
# ( echo "network:"; i=2; for ip in `cat /tmp/nodes `; do echo -e " node$i:\n private:\n iface: eth2\n address: $ip"; pip=`echo $ip | perl -pe 's/(\d+).(\d+).1/\${1}.\${2}.0/g'`; echo -e " public:\n iface: eth1\n address: $pip" ; i=$(( i+=1 )) ;done ) > /root/cluster-topology.yaml
|
||||
( echo "network:"; i=2; for ip in `cat /tmp/nodes `; do echo -e " node$i:\n private:\n address: $ip"; i=$(( i+=1 )) ; done ) > /root/cluster-topology.yaml
|
||||
fi
|
||||
}
|
||||
|
||||
assign_node_roles() {
|
||||
|
@ -28,10 +31,15 @@ assign_node_roles() {
|
|||
done
|
||||
}
|
||||
|
||||
delete_namespace() {
|
||||
kubectl delete namespace openstack && while kubectl get namespace | grep -q ^openstack ; do sleep 5; done
|
||||
}
|
||||
|
||||
deploy_microservices() {
|
||||
mcp-microservices --config-file=/root/mcp.conf deploy -t /root/cluster-topology.yaml &> /var/log/mcp-deploy.log
|
||||
}
|
||||
|
||||
create_network_conf
|
||||
assign_node_roles
|
||||
|
||||
kubectl delete namespace openstack && while kubectl get namespace | grep -q ^openstack ; do sleep 5; done
|
||||
|
||||
mcp-microservices --config-file=/root/mcp.conf deploy -t /root/cluster-topology.yaml &> /var/log/mcp-deploy.log
|
||||
|
||||
delete_namespace
|
||||
deploy_microservices
|
||||
|
|
|
@ -9,12 +9,12 @@
|
|||
rsync_opts:
|
||||
- "--exclude=/microservices-repos"
|
||||
tasks:
|
||||
- name: Patch MCP
|
||||
shell: patch -p1 < ../patch1
|
||||
args:
|
||||
chdir: /root/ccp/microservices/
|
||||
creates: /usr/local/bin/mcp-microservices
|
||||
- name: Install MCP
|
||||
# - name: Patch MCP
|
||||
# shell: patch -p1 < ../patch1
|
||||
# args:
|
||||
# chdir: /root/ccp/microservices/
|
||||
# creates: /usr/local/bin/mcp-microservices
|
||||
- name: Install MCP cli tool
|
||||
shell: "{{ item }}"
|
||||
args:
|
||||
chdir: /root/ccp/microservices/
|
||||
|
@ -22,8 +22,8 @@
|
|||
with_items:
|
||||
- pip install .
|
||||
- python setup.py develop
|
||||
- name: Build CCP images
|
||||
shell: ./ccp-build.sh
|
||||
args:
|
||||
chdir: /root/ccp
|
||||
run_once: true
|
||||
# - name: Build CCP images
|
||||
# shell: ./ccp-build.sh
|
||||
# args:
|
||||
# chdir: /root/ccp
|
||||
# run_once: true
|
||||
|
|
Loading…
Reference in a new issue