Skip to content

Instantly share code, notes, and snippets.

@JamesOBenson
Last active November 28, 2017 18:58
Show Gist options
  • Save JamesOBenson/e987cc470d593589452be59430c5d9ce to your computer and use it in GitHub Desktop.
Save JamesOBenson/e987cc470d593589452be59430c5d9ce to your computer and use it in GitHub Desktop.
# To deploy in Openstack ubuntu server LTS instance:
sudo apt-add-repository ppa:ubuntu-lxc/stable -y
# Using the backports will be supported after the end of 2017, snap is still being developed. As of Nov 28, 2017, backports and regular install are the same.
sudo apt update && sudo apt install -y -t xenial-backports lxd lxd-client
#sudo apt update && sudo apt install -y lxd lxd-client
lxd init --auto
# MTU of 1450 is needed for openstack VM.
lxc network create lxdbr0 ipv4.address=auto ipv4.nat=true ipv6.address=none ipv6.nat=false bridge.mtu=1450
sudo snap install conjure-up --classic
sudo usermod -a -G lxd $(whoami)
conjure-up kubernetes
Canonical
Helm
localhost
flannel
Deploy
sudo snap install kubectl --classic
mkdir ~/.kube
juju scp kubernetes-master/0:/home/ubuntu/config ~/.kube/.
kubectl get nodes
# Make the kubernetes ui available and run in the background
# kubectl proxy --address='192.168.111.11' --accept-hosts='^*\.*\.*\.*' &
kubectl proxy --address='<<Internal IP Address>>' --accept-hosts='^*\.*\.*\.*' &
# Visit http://<<external IP>>:8001/ui
# Be sure that your /etc/hosts has your internal IP with hostname listed.
#Helpful commands:
lxc network list # To verify that the bridge is managed
lxc storage list # To verify that there is storage for t
juju ssh etcd/0 # To ssh into juju lxd container, in this case etcd/0
juju scp etcd/0:/path/to/file . # To scp a file from lxd container to local host
watch -c juju status --color # Watch the juju deploy in real time.
conjure-down
NOTE: Once connections are there, i.e. juju status shows that everything is active, idle and started, conjure-up is complete. At that point, you can copy the config file down and issue kubectl commands.
#Notes:
https://github.com/lxc/lxd/blob/master/doc/production-setup.md
-Be sure MTU's match. In this case, Openstack deploys using an MTU of 1450, lxd, by default, uses 1500. So it was needed to modify the line above to make all containers match so traffic will forward properly.
- https://lxd.readthedocs.io/en/latest/networks/
- https://jujucharms.com/docs/1.24/charms-working-with-units
- https://kubernetes.io/docs/getting-started-guides/ubuntu/local/
# Deploying Docker:
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce=17.09.0~ce-0~ubuntu
# To install Docker Swarm:
sudo docker swarm init
# To install K8S with Docker Swam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment