Created
November 18, 2018 23:37
-
-
Save CalvinHartwell/db7004f54a97a51afbf93e913e73d829 to your computer and use it in GitHub Desktop.
cdk-vmware-example.yaml
This file contains hidden or 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
| #!/bin/bash | |
| # By default, juju will place across zones | |
| # But IDC-HVHV-VMW-05 is used for production | |
| # So we make sure everything goes into IDC-HVHV-VMW-06 | |
| ZONE="IDC-HVHV-VMW-06" | |
| CHARM_CONFIG="bundles/cdk-charm-config.yaml" | |
| DATASTORE="IDC-VNX-HYBRID-01" | |
| # bootstrap controller | |
| juju bootstrap copa --to zone=$ZONE --config primary-network="VLAN DEV" -vvv | |
| # set default model constraints | |
| juju set-model-constraints mem=8G cores=2 root-disk=50G | |
| # add etcd machines | |
| for i in {0..2} ; do juju add-machine zone=$ZONE --constraints datastore=$DATASTORE --constraints root-disk=50G --constraints cores=4 --constraints mem=8G; done | |
| # add kubernetes-master machines | |
| for i in {0..1} ; do juju add-machine zone=$ZONE --constraints datastore=$DATASTORE --constraints root-disk=30G --constraints cores=4 --constraints mem=8G; done | |
| # add kubernetes-worker machines | |
| for i in {0..2} ; do juju add-machine zone=$ZONE --constraints datastore=$DATASTORE --constraints root-disk=30G --constraints cores=4 --constraints mem=8G; done | |
| # add kubeapi-load-balancer machines | |
| for i in {0..1} ; do juju add-machine zone=$ZONE --constraints datastore=$DATASTORE --constraints root-disk=30G --constraints cores=2 --constraints mem=4G; done | |
| # add log-mon machine | |
| juju add-machine zone=$ZONE --constraints datastore=$DATASTORE --constraints root-disk=50G --constraints cores=4 --constraints mem=16G | |
| # add performance mon machine | |
| juju add-machine zone=$ZONE --constraints datastore=$DATASTORE --constraints root-disk=50G --constraints cores=4 --constraints mem=16G | |
| # because of the manual placement, we have to use deploy initially. | |
| juju deploy ~containers/etcd --to 0,1,2 -n 3 --config $CHARM_CONFIG | |
| juju deploy ~containers/kubernetes-master --to 3,4 -n 2 --config $CHARM_CONFIG | |
| juju deploy ~containers/kubernetes-worker --to 5,6,7 -n 3 --config $CHARM_CONFIG | |
| juju deploy ~containers/kubeapi-load-balancer --to 8,9 -n 2 | |
| juju deploy ~containers/easyrsa --to lxd:3 | |
| juju deploy ~containers/flannel | |
| juju deploy ~containers/vsphere-integrator --to 3 | |
| # deploy logging and monitoring stack | |
| juju deploy apache2-26 --to 10 --config $CHARM_CONFIG | |
| juju deploy elasticsearch-31 --to 10 | |
| juju deploy filebeat-19 --config $CHARM_CONFIG | |
| juju deploy grafana-20 --to 11 | |
| juju deploy graylog-20 --to 10 | |
| juju deploy mongodb-51 --to 11 --config $CHARM_CONFIG | |
| juju deploy prometheus2-8 --to 11 | |
| juju deploy telegraf-22 | |
| # setup the relationships | |
| juju relate kubernetes-master:kube-api-endpoint kubeapi-load-balancer:apiserver | |
| juju relate kubernetes-master:loadbalancer kubeapi-load-balancer:loadbalancer | |
| juju relate kubernetes-master:kube-control kubernetes-worker:kube-control | |
| juju relate kubernetes-master:certificates easyrsa:client | |
| juju relate etcd:certificates easyrsa:client | |
| juju relate kubernetes-master:etcd etcd:db | |
| juju relate kubernetes-worker:certificates easyrsa:client | |
| juju relate kubernetes-worker:kube-api-endpoint kubeapi-load-balancer:website | |
| juju relate kubeapi-load-balancer:certificates easyrsa:client | |
| juju relate flannel:etcd etcd:db | |
| juju relate flannel:cni kubernetes-master:cni | |
| juju relate flannel:cni kubernetes-worker:cni | |
| juju relate apache2:reverseproxy graylog:website | |
| juju relate graylog:elasticsearch elasticsearch:client | |
| juju relate graylog:mongodb mongodb:database | |
| juju relate filebeat:beats-host kubernetes-master:juju-info | |
| juju relate filebeat:beats-host kubernetes-worker:juju-info | |
| juju relate filebeat:logstash graylog:beats | |
| juju relate prometheus2:grafana-source grafana:grafana-source | |
| juju relate telegraf:prometheus-client prometheus2:target | |
| juju relate kubernetes-master:juju-info telegraf:juju-info | |
| juju relate kubernetes-worker:juju-info telegraf:juju-info | |
| # deployment... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment