2018-01-16 01:16:18 +00:00
|
|
|
apiVersion: v1
|
|
|
|
kind: Namespace
|
|
|
|
metadata:
|
|
|
|
name: longhorn-system
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: ServiceAccount
|
2017-12-06 02:37:00 +00:00
|
|
|
metadata:
|
|
|
|
name: longhorn-service-account
|
2018-01-16 01:16:18 +00:00
|
|
|
namespace: longhorn-system
|
2017-12-06 02:37:00 +00:00
|
|
|
---
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
|
|
|
kind: ClusterRole
|
|
|
|
metadata:
|
|
|
|
name: longhorn-role
|
|
|
|
rules:
|
|
|
|
- apiGroups:
|
|
|
|
- apiextensions.k8s.io
|
|
|
|
resources:
|
|
|
|
- customresourcedefinitions
|
|
|
|
verbs:
|
|
|
|
- "*"
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources: ["pods"]
|
|
|
|
verbs: ["*"]
|
2018-01-16 01:16:18 +00:00
|
|
|
- apiGroups: ["batch"]
|
|
|
|
resources: ["jobs"]
|
|
|
|
verbs: ["*"]
|
2017-12-06 02:37:00 +00:00
|
|
|
- apiGroups: ["longhorn.rancher.io"]
|
|
|
|
resources: ["nodes"]
|
|
|
|
verbs: ["*"]
|
|
|
|
- apiGroups: ["longhorn.rancher.io"]
|
|
|
|
resources: ["volumes"]
|
|
|
|
verbs: ["*"]
|
|
|
|
- apiGroups: ["longhorn.rancher.io"]
|
|
|
|
resources: ["replicas"]
|
|
|
|
verbs: ["*"]
|
|
|
|
- apiGroups: ["longhorn.rancher.io"]
|
|
|
|
resources: ["settings"]
|
|
|
|
verbs: ["*"]
|
|
|
|
- apiGroups: ["longhorn.rancher.io"]
|
|
|
|
resources: ["controllers"]
|
|
|
|
verbs: ["*"]
|
|
|
|
---
|
2018-01-16 01:16:18 +00:00
|
|
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
|
|
|
kind: ClusterRoleBinding
|
2017-12-06 02:37:00 +00:00
|
|
|
metadata:
|
2018-01-16 01:16:18 +00:00
|
|
|
name: longhorn-bind
|
|
|
|
roleRef:
|
|
|
|
apiGroup: rbac.authorization.k8s.io
|
|
|
|
kind: ClusterRole
|
|
|
|
name: longhorn-role
|
|
|
|
subjects:
|
|
|
|
- kind: ServiceAccount
|
2017-12-06 02:37:00 +00:00
|
|
|
name: longhorn-service-account
|
2018-01-16 01:16:18 +00:00
|
|
|
namespace: longhorn-system
|
2017-12-06 02:37:00 +00:00
|
|
|
---
|
|
|
|
apiVersion: extensions/v1beta1
|
|
|
|
kind: DaemonSet
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: longhorn-manager
|
|
|
|
name: longhorn-manager
|
2018-01-16 01:16:18 +00:00
|
|
|
namespace: longhorn-system
|
2017-12-06 02:37:00 +00:00
|
|
|
spec:
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: longhorn-manager
|
|
|
|
spec:
|
|
|
|
initContainers:
|
|
|
|
- name: init-container
|
|
|
|
image: rancher/longhorn-engine:17e33fc
|
|
|
|
command: ['sh', '-c', 'cp /usr/local/bin/* /data/']
|
|
|
|
volumeMounts:
|
|
|
|
- name: execbin
|
|
|
|
mountPath: /data/
|
|
|
|
containers:
|
|
|
|
- name: longhorn-manager
|
2018-01-16 01:16:18 +00:00
|
|
|
image: rancher/longhorn-manager:4d21cac
|
2017-12-06 02:37:00 +00:00
|
|
|
securityContext:
|
|
|
|
privileged: true
|
|
|
|
command: ["launch-manager", "-d",
|
|
|
|
"--orchestrator", "kubernetes",
|
|
|
|
"--engine-image", "rancher/longhorn-engine:17e33fc"]
|
|
|
|
ports:
|
|
|
|
- containerPort: 9500
|
|
|
|
name: manager
|
|
|
|
volumeMounts:
|
|
|
|
- name: dev
|
|
|
|
mountPath: /host/dev/
|
|
|
|
- name: proc
|
|
|
|
mountPath: /host/proc/
|
|
|
|
- name: varrun
|
|
|
|
mountPath: /var/run/
|
|
|
|
- name: longhorn
|
|
|
|
mountPath: /var/lib/rancher/longhorn/
|
|
|
|
- name: execbin
|
|
|
|
mountPath: /usr/local/bin/
|
|
|
|
env:
|
|
|
|
- name: POD_NAMESPACE
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: metadata.namespace
|
|
|
|
- name: POD_IP
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: status.podIP
|
|
|
|
- name: NODE_NAME
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: spec.nodeName
|
|
|
|
volumes:
|
|
|
|
- name: dev
|
|
|
|
hostPath:
|
|
|
|
path: /dev/
|
|
|
|
- name: proc
|
|
|
|
hostPath:
|
|
|
|
path: /proc/
|
|
|
|
- name: varrun
|
|
|
|
hostPath:
|
|
|
|
path: /var/run/
|
|
|
|
- name: longhorn
|
|
|
|
hostPath:
|
|
|
|
path: /var/lib/rancher/longhorn/
|
|
|
|
- name: execbin
|
|
|
|
emptyDir: {}
|
|
|
|
serviceAccountName: longhorn-service-account
|
|
|
|
---
|
|
|
|
kind: Service
|
|
|
|
apiVersion: v1
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: longhorn-manager
|
|
|
|
name: longhorn-backend
|
2018-01-16 01:16:18 +00:00
|
|
|
namespace: longhorn-system
|
2017-12-06 02:37:00 +00:00
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
app: longhorn-manager
|
|
|
|
ports:
|
|
|
|
- name: manager
|
|
|
|
port: 9500
|
|
|
|
targetPort: manager
|
|
|
|
sessionAffinity: ClientIP
|
|
|
|
---
|
|
|
|
apiVersion: extensions/v1beta1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: longhorn-ui
|
|
|
|
name: longhorn-ui
|
2018-01-16 01:16:18 +00:00
|
|
|
namespace: longhorn-system
|
2017-12-06 02:37:00 +00:00
|
|
|
spec:
|
|
|
|
replicas: 1
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: longhorn-ui
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- name: longhorn-ui
|
2018-01-16 01:16:18 +00:00
|
|
|
image: rancher/longhorn-ui:99622cb
|
2017-12-06 02:37:00 +00:00
|
|
|
ports:
|
|
|
|
- containerPort: 8000
|
|
|
|
name: longhorn-ui
|
|
|
|
env:
|
|
|
|
- name: LONGHORN_MANAGER_IP
|
|
|
|
value: "http://longhorn-backend:9500"
|
|
|
|
---
|
|
|
|
kind: Service
|
|
|
|
apiVersion: v1
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: longhorn-ui
|
|
|
|
name: longhorn-frontend
|
2018-01-16 01:16:18 +00:00
|
|
|
namespace: longhorn-system
|
2017-12-06 02:37:00 +00:00
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
app: longhorn-ui
|
|
|
|
ports:
|
|
|
|
- name: longhorn-ui
|
|
|
|
port: 80
|
|
|
|
targetPort: longhorn-ui
|
|
|
|
type: LoadBalancer
|
|
|
|
sessionAffinity: ClientIP
|
|
|
|
---
|
|
|
|
apiVersion: extensions/v1beta1
|
|
|
|
kind: DaemonSet
|
|
|
|
metadata:
|
|
|
|
name: longhorn-driver
|
2018-01-16 01:16:18 +00:00
|
|
|
namespace: longhorn-system
|
2017-12-06 02:37:00 +00:00
|
|
|
spec:
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
name: longhorn-driver
|
|
|
|
labels:
|
|
|
|
app: longhorn-driver
|
|
|
|
spec:
|
2018-01-16 01:16:18 +00:00
|
|
|
initContainers:
|
|
|
|
- name: init-container
|
|
|
|
image: rancher/longhorn-driver:4d21cac
|
|
|
|
securityContext:
|
|
|
|
privileged: true
|
|
|
|
command: ["/checkdependency.sh"]
|
|
|
|
volumeMounts:
|
|
|
|
- name: host-proc-mount
|
|
|
|
mountPath: /host/proc/
|
2017-12-06 02:37:00 +00:00
|
|
|
containers:
|
2018-01-16 01:16:18 +00:00
|
|
|
- image: rancher/longhorn-driver:4d21cac
|
2017-12-06 02:37:00 +00:00
|
|
|
imagePullPolicy: Always
|
|
|
|
name: longhorn-driver-container
|
|
|
|
command: ["/entrypoint.sh"]
|
|
|
|
securityContext:
|
|
|
|
privileged: true
|
|
|
|
volumeMounts:
|
|
|
|
- mountPath: /flexmnt
|
|
|
|
name: flexvolume-longhorn-mount
|
2018-01-16 01:16:18 +00:00
|
|
|
- mountPath: /binmnt
|
|
|
|
name: usr-local-bin-mount
|
2017-12-06 02:37:00 +00:00
|
|
|
env:
|
|
|
|
- name: LONGHORN_BACKEND_SVC
|
|
|
|
value: "longhorn-backend"
|
|
|
|
- name: NODE_NAME
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: spec.nodeName
|
|
|
|
volumes:
|
|
|
|
- name: flexvolume-longhorn-mount
|
|
|
|
hostPath:
|
2018-01-16 01:16:18 +00:00
|
|
|
path: /usr/libexec/kubernetes/kubelet-plugins/volume/exec/
|
|
|
|
#FOR GKE
|
|
|
|
#path: /home/kubernetes/flexvolume/
|
|
|
|
- name: usr-local-bin-mount
|
|
|
|
hostPath:
|
|
|
|
path: /usr/local/bin/
|
|
|
|
- name: host-proc-mount
|
|
|
|
hostPath:
|
|
|
|
path: /proc/
|