Skip to content

Instantly share code, notes, and snippets.

@muka
Last active Feb 17, 2020
Embed
What would you like to do?
kubeflow 1.0RC / kubernetes v1.15 setup
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: httpbin-gateway
spec:
selector:
istio: ingressgateway # use Istio default gateway implementation
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: httpbin
spec:
hosts:
- "*"
gateways:
- httpbin-gateway
http:
- match:
- uri:
prefix: /headers
route:
- destination:
port:
number: 8000
host: httpbin

ref https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/

  1. install kubeflow and docker installed
  2. setup flannel as described https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/#tabs-pod-install-3
  3. set single cluster machine
sudo apt install kubectl kubeadm=1.15.10-00 kubectl=1.15.10-00 kubelet=1.15.10-00
kubeadm init --control-plane-endpoint kube1.labs --pod-network-cidr=10.244.0.0/16 --kubernetes-version v1.15

# add under section command to /etc/kubernetes/manifests/kube-apiserver.yaml 
# to support thrustworthy tokens
  - --service-account-issuer=kubernetes.default.svc
  - --service-account-signing-key-file=/etc/kubernetes/pki/sa.key


#flannel

echo 'net.bridge.bridge-nf-call-iptables=1' | sudo tee -a /etc/sysctl.conf
sudo sysctl net.bridge.bridge-nf-call-iptables=1
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/2140ac876ef134e0ed5af15c65e414cf26827915/Documentation/kube-flannel.yml
# allow master to run as cluster
kubectl taint nodes --all node-role.kubernetes.io/master-

# add kubectl config
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

# Create manually storage, TODO see NFS or block storage as alternative
kubectl apply -f https://gist.githubusercontent.com/muka/f91aa4afbbbe5cfb7cbbb7e19109b896/raw/4afbee28ff3f5d2ee8befbafcd15649fa10805a7/storage.yml


# Create istion ingress 
# https://istio.io/docs/tasks/traffic-management/ingress/ingress-control/

# set external ip to node host
kubectl patch svc -n istio-system istio-ingressgateway -p '{"spec":{"externalIPs":["192.168.1.14"]}}'


export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}')
export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].nodePort}')
export INGRESS_HOST=$(kubectl get po -l istio=ingressgateway -n istio-system -o jsonpath='{.items[0].status.hostIP}')


kubectl apply -f https://gist.github.com/muka/f91aa4afbbbe5cfb7cbbb7e19109b896/raw/4afbee28ff3f5d2ee8befbafcd15649fa10805a7/istio_httpbin.yml


kind: PersistentVolume
apiVersion: v1
metadata:
name: pv-volume1
spec:
storageClassName:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/pv1"
---
kind: PersistentVolume
apiVersion: v1
metadata:
name: pv-volume2
spec:
storageClassName:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/pv2"
---
kind: PersistentVolume
apiVersion: v1
metadata:
name: pv-volume3
spec:
storageClassName:
capacity:
storage: 20Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/pv3"
---
kind: PersistentVolume
apiVersion: v1
metadata:
name: pv-volume4
spec:
storageClassName:
capacity:
storage: 20Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/pv4"
---
kind: PersistentVolume
apiVersion: v1
metadata:
name: pv-volume5
spec:
storageClassName:
capacity:
storage: 20Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/pv5"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment