Quick Juju Kubernetes demo
On AWS, an example using dynamic persistent volumes and 2 charms related together.
juju bootstrap aws
juju deploy kubernetes-core
juju deploy aws-integrator
juju trust aws-integrator
Wait for juju status
to go green.
juju scp kubernetes-master/0:config ~/.kube/config
juju add-k8s myk8scloud
juju add-model myk8smodel myk8scloud
juju create-storage-pool operator-storage kubernetes storage-class=juju-operator-storage storage-provisioner=kubernetes.io/aws-ebs parameters.type=gp2
juju create-storage-pool k8s-ebs kubernetes storage-class=juju-ebs storage-provisioner=kubernetes.io/aws-ebs parameters.type=gp2
The above can be set up ahead of time.
Run up the Juju GUI.
juju gui
Select the myk8smodel
model.
Deploy mariadb.
juju deploy cs:~wallyworld/mariadb-k8s --storage database=10M,k8s-ebs
Now you can see the storage being created/attached using juju storage
.
juju storage
or
juju storage --filesystem
or
juju storage --volume
or
juju storage --format yaml
You can also see the persistent volumes and volume claims being created in Kubernetes.
kubectl -n myk8smodel get all,pvc,pv
It will take a minue but the above Juju commands will ultimately show storage provisioned and attached the mariadb charm running.
Deploy gitlab and relate to mariadb.
juju deploy cs:~wallyworld/gitlab-k8s
juju relate gitlab mariadb
Because this is on AWS, an ELB is used to give gitlab a public hostname without needed to juju expose
. You can see what this hostname is by running juju status
.
Stick that hostname in a browser and it will take a few minutes (gitlab takes a while to start) but you’ll eventually get the gitlab login page.