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
|
|
|
---
|
2018-01-23 02:33:34 +00:00
|
|
|
apiVersion: apiextensions.k8s.io/v1beta1
|
|
|
|
kind: CustomResourceDefinition
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
longhorn-manager: Controller
|
|
|
|
name: controllers.longhorn.rancher.io
|
|
|
|
spec:
|
|
|
|
group: longhorn.rancher.io
|
|
|
|
names:
|
|
|
|
kind: Controller
|
|
|
|
listKind: ControllerList
|
|
|
|
plural: controllers
|
|
|
|
shortNames:
|
|
|
|
- lhc
|
|
|
|
singular: controller
|
|
|
|
scope: Namespaced
|
|
|
|
version: v1alpha1
|
|
|
|
---
|
|
|
|
apiVersion: apiextensions.k8s.io/v1beta1
|
|
|
|
kind: CustomResourceDefinition
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
longhorn-manager: Node
|
|
|
|
name: nodes.longhorn.rancher.io
|
|
|
|
spec:
|
|
|
|
group: longhorn.rancher.io
|
|
|
|
names:
|
|
|
|
kind: Node
|
|
|
|
listKind: NodeList
|
|
|
|
plural: nodes
|
|
|
|
shortNames:
|
|
|
|
- lhn
|
|
|
|
singular: node
|
|
|
|
scope: Namespaced
|
|
|
|
version: v1alpha1
|
|
|
|
---
|
|
|
|
apiVersion: apiextensions.k8s.io/v1beta1
|
|
|
|
kind: CustomResourceDefinition
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
longhorn-manager: Replica
|
|
|
|
name: replicas.longhorn.rancher.io
|
|
|
|
spec:
|
|
|
|
group: longhorn.rancher.io
|
|
|
|
names:
|
|
|
|
kind: Replica
|
|
|
|
listKind: ReplicaList
|
|
|
|
plural: replicas
|
|
|
|
shortNames:
|
|
|
|
- lhr
|
|
|
|
singular: replica
|
|
|
|
scope: Namespaced
|
|
|
|
version: v1alpha1
|
|
|
|
---
|
|
|
|
apiVersion: apiextensions.k8s.io/v1beta1
|
|
|
|
kind: CustomResourceDefinition
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
longhorn-manager: Setting
|
|
|
|
name: settings.longhorn.rancher.io
|
|
|
|
spec:
|
|
|
|
group: longhorn.rancher.io
|
|
|
|
names:
|
|
|
|
kind: Setting
|
|
|
|
listKind: SettingList
|
|
|
|
plural: settings
|
|
|
|
shortNames:
|
|
|
|
- lhs
|
|
|
|
singular: setting
|
|
|
|
scope: Namespaced
|
|
|
|
version: v1alpha1
|
|
|
|
---
|
|
|
|
apiVersion: apiextensions.k8s.io/v1beta1
|
|
|
|
kind: CustomResourceDefinition
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
longhorn-manager: Volume
|
|
|
|
name: volumes.longhorn.rancher.io
|
|
|
|
spec:
|
|
|
|
group: longhorn.rancher.io
|
|
|
|
names:
|
|
|
|
kind: Volume
|
|
|
|
listKind: VolumeList
|
|
|
|
plural: volumes
|
|
|
|
shortNames:
|
|
|
|
- lhv
|
|
|
|
singular: volume
|
|
|
|
scope: Namespaced
|
|
|
|
version: v1alpha1
|
|
|
|
---
|
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
|
2018-01-23 02:33:34 +00:00
|
|
|
image: rancher/longhorn-engine:8c8289f
|
2017-12-06 02:37:00 +00:00
|
|
|
command: ['sh', '-c', 'cp /usr/local/bin/* /data/']
|
|
|
|
volumeMounts:
|
|
|
|
- name: execbin
|
|
|
|
mountPath: /data/
|
|
|
|
containers:
|
|
|
|
- name: longhorn-manager
|
2018-01-24 22:44:28 +00:00
|
|
|
image: rancher/longhorn-manager:ea71bd3
|
2018-01-23 02:33:34 +00:00
|
|
|
imagePullPolicy: Always
|
2017-12-06 02:37:00 +00:00
|
|
|
securityContext:
|
|
|
|
privileged: true
|
|
|
|
command: ["launch-manager", "-d",
|
|
|
|
"--orchestrator", "kubernetes",
|
2018-01-23 02:33:34 +00:00
|
|
|
"--engine-image", "rancher/longhorn-engine:8c8289f"]
|
2017-12-06 02:37:00 +00:00
|
|
|
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
|
2018-01-24 22:44:28 +00:00
|
|
|
image: rancher/longhorn-driver:ea71bd3
|
2018-01-16 01:16:18 +00:00
|
|
|
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-24 22:44:28 +00:00
|
|
|
- image: rancher/longhorn-driver:ea71bd3
|
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:
|
2018-01-16 01:16:18 +00:00
|
|
|
- name: usr-local-bin-mount
|
|
|
|
hostPath:
|
|
|
|
path: /usr/local/bin/
|
|
|
|
- name: host-proc-mount
|
|
|
|
hostPath:
|
|
|
|
path: /proc/
|
2018-01-23 02:33:34 +00:00
|
|
|
- name: flexvolume-longhorn-mount
|
|
|
|
hostPath:
|
|
|
|
path: /usr/libexec/kubernetes/kubelet-plugins/volume/exec/
|
|
|
|
#FOR GKE
|
|
|
|
#path: /home/kubernetes/flexvolume/
|
|
|
|
---
|