mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-16 10:40:04 -03:30
Switch to using prebuilt CCP images
This commit is contained in:
@@ -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() {
|
||||
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
|
||||
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 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
|
||||
|
||||
Reference in New Issue
Block a user