cleaning up, adding more comments
This commit is contained in:
parent
769fdd67a7
commit
decc4b06e1
@ -41,12 +41,24 @@ maas admin vm-hosts create password=password type=lxd power_address=https://${
|
|||||||
# TODO find out the name of our vm host, and store this id in a variable
|
# TODO find out the name of our vm host, and store this id in a variable
|
||||||
maas admin vm-hosts read | jq '.[] | select (.name=="proud-possum") | .name, .id'
|
maas admin vm-hosts read | jq '.[] | select (.name=="proud-possum") | .name, .id'
|
||||||
# add a VM for the juju controller with minimal memory
|
# add a VM for the juju controller with minimal memory
|
||||||
# TODO use the variable for the VM host ID (below it is static 1)
|
# TODO use the variable for the VM host ID (below it is static 1). If you don't have 8 cores, change this to 4.
|
||||||
maas admin vm-host compose 1 cores=8 memory=2048 architecture="amd64/generic" storage="main:16(pool1)"
|
maas admin vm-host compose 1 cores=8 memory=2048 architecture="amd64/generic" storage="main:16(pool1)"
|
||||||
#TODO get the system_id from output of above, and use it with:
|
#TODO get the system_id from output of above, and use it with:
|
||||||
# maas admin tag update-nodes "juju-controller" add=$TAG
|
# maas admin tag update-nodes "juju-controller" add=$SYSTEM-ID
|
||||||
|
|
||||||
# Juju (note, this section requires manual intervention)
|
## Create 3 "bare metal" machines
|
||||||
|
maas admin vm-host compose 1 cores=8 memory=8192 architecture="amd64/generic" storage="main:25(pool1),ceph:150(pool1)" hostname="metal-1"
|
||||||
|
# TODO grab system-id and tag machine "metal"
|
||||||
|
maas admin vm-host compose 1 cores=8 memory=8192 architecture="amd64/generic" storage="main:25(pool1),ceph:150(pool1)" hostname="metal-2"
|
||||||
|
# TODO grab system-id and tag machine "metal"
|
||||||
|
maas admin vm-host compose 1 cores=8 memory=8192 architecture="amd64/generic" storage="main:25(pool1),ceph:150(pool1)" hostname="metal-3"
|
||||||
|
# TODO grab system-id and tag machine "metal"
|
||||||
|
|
||||||
|
# Go to the MAAS UI, log in with username admin password admin, and tag the machines
|
||||||
|
# Browse to http://localhost:5240/MAAS/ - select the 3 machines metal-1, metal-2, and metal-3, click actions - add tag "metal"
|
||||||
|
|
||||||
|
### Juju setup (note, this section requires manual intervention)
|
||||||
|
cd ~
|
||||||
sudo snap install juju --classic
|
sudo snap install juju --classic
|
||||||
sed -i 's/IP_ADDRESS/${IP_ADDRESS}/' maas-cloud.yaml
|
sed -i 's/IP_ADDRESS/${IP_ADDRESS}/' maas-cloud.yaml
|
||||||
juju add-cloud --local maas-cloud maas-cloud.yaml
|
juju add-cloud --local maas-cloud maas-cloud.yaml
|
||||||
@ -56,54 +68,54 @@ juju credentials
|
|||||||
# Bootstrap the maas-cloud - get a coffee
|
# Bootstrap the maas-cloud - get a coffee
|
||||||
juju bootstrap maas-cloud --bootstrap-constraints "tags=juju-controller mem=2G"
|
juju bootstrap maas-cloud --bootstrap-constraints "tags=juju-controller mem=2G"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# fire up the juju gui to view the fun
|
# fire up the juju gui to view the fun
|
||||||
juju gui
|
juju gui
|
||||||
# get coffee
|
# get coffee
|
||||||
|
|
||||||
|
### Ceph
|
||||||
# get some storage going
|
|
||||||
# https://jaas.ai/ceph-base
|
|
||||||
# https://jaas.ai/canonical-kubernetes/bundle/471
|
|
||||||
|
|
||||||
# TODO do we need to create ceph-mon machines?
|
|
||||||
maas admin vm-host compose 1 cores=8 memory=8192 architecture="amd64/generic" storage="main:25(pool1),ceph:150(pool1)" hostname="metal-1"
|
|
||||||
# TODO grab system-id and tag machine "metal"
|
|
||||||
maas admin vm-host compose 1 cores=8 memory=8192 architecture="amd64/generic" storage="main:25(pool1),ceph:150(pool1)" hostname="metal-2"
|
|
||||||
# TODO grab system-id and tag machine "metal"
|
|
||||||
maas admin vm-host compose 1 cores=8 memory=8192 architecture="amd64/generic" storage="main:25(pool1),ceph:150(pool1)" hostname="metal-3"
|
|
||||||
# TODO grab system-id and tag machine "metal"
|
|
||||||
|
|
||||||
|
|
||||||
# Deploy Ceph
|
|
||||||
juju deploy -n 3 ceph-mon --to lxd:0,lxd:1,lxd:2
|
juju deploy -n 3 ceph-mon --to lxd:0,lxd:1,lxd:2
|
||||||
juju deploy --config ceph-osd.yaml cs:ceph-osd -n 3 --to 0,1,2
|
juju deploy --config ceph-osd.yaml cs:ceph-osd -n 3 --to 0,1,2
|
||||||
juju add-relation ceph-mon ceph-osd
|
juju add-relation ceph-mon ceph-osd
|
||||||
|
|
||||||
# watch the fun (with a another coffee)
|
# watch the fun (with a another coffee).
|
||||||
watch -c juju status --color
|
watch -c juju status --color
|
||||||
|
# Wait for Ceph to settle before proceeding
|
||||||
|
|
||||||
# deploy kubernetes-core with juju and re-use existing machines
|
### Kubernetes
|
||||||
|
|
||||||
|
# Deploy kubernetes-core with juju and re-use existing machines.
|
||||||
juju deploy kubernetes-core --map-machines=existing,0=0,1=1
|
juju deploy kubernetes-core --map-machines=existing,0=0,1=1
|
||||||
#juju deploy kubernetes-core
|
|
||||||
# add the new kubernetes as a cloud to juju
|
# add the new kubernetes as a cloud to juju
|
||||||
mkdir ~/.kube
|
mkdir ~/.kube
|
||||||
juju scp kubernetes-master/0:/home/ubuntu/config ~/.kube/config
|
juju scp kubernetes-master/1:/home/ubuntu/config ~/.kube/config
|
||||||
|
|
||||||
# add storage relations
|
# add storage relations
|
||||||
juju add-relation ceph-mon:admin kubernetes-master
|
juju add-relation ceph-mon:admin kubernetes-master
|
||||||
juju add-relation ceph-mon:client kubernetes-master
|
juju add-relation ceph-mon:client kubernetes-master
|
||||||
|
|
||||||
# add k8s to juju
|
# add k8s to juju (choose option 1, client only)
|
||||||
juju add-k8s my-k8s
|
juju add-k8s my-k8s
|
||||||
|
|
||||||
juju bootstrap my-k8s
|
juju bootstrap my-k8s
|
||||||
|
|
||||||
# add a model (k8s namespace) to the cluster
|
|
||||||
juju add-model k8s-model my-k8s
|
|
||||||
|
|
||||||
# add an LMA model to the cluster
|
|
||||||
|
### Deploying applications
|
||||||
|
# juju add-model some-model my-k8s
|
||||||
|
# juju deploy someapp(s)
|
||||||
|
|
||||||
|
### Cleanup? not sure this always works.
|
||||||
|
|
||||||
|
#juju destroy-controller -y --destroy-all-models --destroy-storage maas-cloud-default
|
||||||
|
|
||||||
|
### Notes / LMA stack deployment
|
||||||
|
## add an LMA model to the cluster
|
||||||
juju add-model lma my-k8s
|
juju add-model lma my-k8s
|
||||||
|
|
||||||
juju deploy lma-light --channel=edge --trust
|
juju deploy lma-light --channel=edge --trust
|
||||||
#juju destroy-controller -y --destroy-all-models --destroy-storage maas-cloud-default
|
|
||||||
|
## random notes
|
||||||
|
# get some storage going
|
||||||
|
# https://jaas.ai/ceph-base
|
||||||
|
# https://jaas.ai/canonical-kubernetes/bundle/471
|
Loading…
Reference in New Issue
Block a user