Created
October 2, 2018 13:31
-
-
Save danrjohnson/3303caecfd8b780bbb6b1b64043e0c6e to your computer and use it in GitHub Desktop.
Kubernetes Demo -- Platform
This file contains 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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: dropwizard-api | |
labels: | |
app: dropwizard | |
spec: | |
replicas: 3 | |
selector: | |
matchLabels: | |
app: dropwizard | |
template: | |
metadata: | |
labels: | |
app: dropwizard | |
spec: | |
containers: | |
- name: dropwizard-application | |
image: danrjohnson/dropwizardexample | |
ports: | |
- containerPort: 8080 |
This file contains 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
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: gethostname | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
labels: | |
app: gethostname | |
spec: | |
containers: | |
- name: gethostname | |
image: danrjohnson/gethostname:latest | |
ports: | |
- containerPort: 8080 |
This file contains 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
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: dropwizard-api | |
labels: | |
name: dropwizard | |
spec: | |
containers: | |
- name: dropwizard-application | |
image: danrjohnson/dropwizardexample | |
ports: | |
- containerPort: 8080 |
This file contains 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
apiVersion: apps/v1 | |
kind: ReplicaSet | |
metadata: | |
name: dropwizard-api | |
labels: | |
app: dropwizard | |
spec: | |
replicas: 3 | |
selector: | |
matchLabels: | |
app: dropwizard | |
template: | |
metadata: | |
labels: | |
app: dropwizard | |
spec: | |
containers: | |
- name: dropwizard-application | |
image: danrjohnson/dropwizardexample | |
ports: | |
- containerPort: 8080 |
This file contains 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
kind: Service | |
apiVersion: v1 | |
metadata: | |
name: dropwizard-service | |
spec: | |
selector: | |
app: dropwizard | |
ports: | |
- protocol: TCP | |
port: 80 | |
targetPort: 8080 | |
type: LoadBalancer |
This file contains 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
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: gethostnames | |
labels: | |
app: gethostname | |
spec: | |
# if your cluster supports it, uncomment the following to automatically create | |
# an external load-balanced IP for the frontend service. | |
type: LoadBalancer | |
ports: | |
# the port that this service should serve on | |
- port: 8080 | |
selector: | |
app: gethostname |
This file contains 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
#Vagrant::DEFAULT_SERVER_URL.replace('https://vagrantcloud.com') | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure("2") do |config| | |
config.vm.box = "bento/ubuntu-18.04" | |
config.vm.network "forwarded_port", guest: 8443, host: 8443 | |
config.vm.network "forwarded_port", guest: 8001, host: 8001 | |
config.vm.network "forwarded_port", guest: 30000, host: 30000 | |
config.vm.provision "shell", inline: <<-SHELL | |
apt-get update | |
apt-get install -y apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
apt-key fingerprint 0EBFCD88 | |
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - | |
sudo touch /etc/apt/sources.list.d/kubernetes.list | |
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list | |
apt-get update | |
apt-get install -y docker-ce kubectl | |
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.28.2/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/ | |
echo "alias minikubestart='sudo minikube start --vm-driver=none'" >> /home/vagrant/.bashrc | |
minikube start --vm-driver=none | |
mv /root/.kube /home/vagrant/.kube # this will write over any previous configuration | |
chown -R vagrant /home/vagrant/.kube | |
chgrp -R vagrant /home/vagrant/.kube | |
mv /root/.minikube /home/vagrant/.minikube # this will write over any previous configuration | |
chown -R vagrant /home/vagrant/.minikube | |
chgrp -R vagrant /home/vagrant/.minikube | |
sed -i 's@root@home\/vagrant@' /home/vagrant/.kube/config | |
SHELL | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment