examples: k8s: added manifest for scope deployment

- closes https://github.com/weaveworks/scope/issues/3153
This commit is contained in:
Tasdik Rahman
2018-05-02 17:39:26 +05:30
parent d19b0293f6
commit eb849432a1
7 changed files with 193 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
# borrowed from https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.9.3
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: weave-scope
labels:
name: weave-scope
namespace: weave
roleRef:
kind: ClusterRole
name: weave-scope
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: weave-scope
namespace: weave

View File

@@ -0,0 +1,44 @@
# borrowed from https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.9.3
# with little modificatios to reduce permissions
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
name: weave-scope
name: weave-scope
namespace: weave
rules:
- apiGroups:
- ""
resources:
- pods
- replicationcontrollers
- services
- nodes
verbs:
- list
- watch
- apiGroups:
- apps
resources:
- statefulsets
verbs:
- list
- watch
- apiGroups:
- batch
resources:
- cronjobs
- jobs
verbs:
- list
- watch
- apiGroups:
- extensions
resources:
- daemonsets
- deployments
- replicasets
verbs:
- list
- watch

32
examples/k8s/deploy.yaml Normal file
View File

@@ -0,0 +1,32 @@
# borrowed from https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.9.3
apiVersion: apps/v1
kind: Deployment
metadata:
name: weave-scope-app
labels:
name: weave-scope-app
app: weave-scope
weave-cloud-component: scope
weave-scope-component: app
namespace: weave
spec:
replicas: 1
revisionHistoryLimit: 2
template:
metadata:
labels:
name: weave-scope-app
app: weave-scope
weave-cloud-component: scope
weave-scope-component: app
spec:
containers:
- name: app
args:
- '--no-probe'
env: []
image: weaveworks/scope:1.9.0
imagePullPolicy: IfNotPresent
ports:
- containerPort: 4040
protocol: TCP

66
examples/k8s/ds.yaml Normal file
View File

@@ -0,0 +1,66 @@
# borrowed from https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.9.3
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: weave-scope-agent
labels:
name: weave-scope-agent
app: weave-scope
weave-cloud-component: scope
weave-scope-component: agent
namespace: weave
spec:
minReadySeconds: 5
template:
metadata:
labels:
name: weave-scope-agent
app: weave-scope
weave-cloud-component: scope
weave-scope-component: agent
spec:
containers:
- name: scope-agent
args:
- '--no-app'
- '--probe.docker.bridge=docker0'
- '--probe.docker=true'
- '--probe.kubernetes=true'
- 'weave-scope-app.weave.svc.cluster.local:80'
env:
- name: KUBERNETES_HOSTNAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
image: weaveworks/scope:1.9.0
imagePullPolicy: IfNotPresent
securityContext:
privileged: true
volumeMounts:
- name: docker-socket
mountPath: /var/run/docker.sock
- name: scope-plugins
mountPath: /var/run/scope/plugins
- name: sys-kernel-debug
mountPath: /sys/kernel/debug
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: true
hostPID: true
serviceAccountName: weave-scope
tolerations:
- effect: NoSchedule
operator: Exists
volumes:
- name: docker-socket
hostPath:
path: /var/run/docker.sock
- name: scope-plugins
hostPath:
path: /var/run/scope/plugins
- name: sys-kernel-debug
hostPath:
path: /sys/kernel/debug
updateStrategy:
rollingUpdate:
maxUnavailable: 1

5
examples/k8s/ns.yaml Normal file
View File

@@ -0,0 +1,5 @@
# borrowed from https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.9.3
apiVersion: v1
kind: Namespace
metadata:
name: weave

8
examples/k8s/sa.yaml Normal file
View File

@@ -0,0 +1,8 @@
# borrowed from https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.9.3
apiVersion: v1
kind: ServiceAccount
metadata:
name: weave-scope
labels:
name: weave-scope
namespace: weave

22
examples/k8s/svc.yaml Normal file
View File

@@ -0,0 +1,22 @@
# borrowed from https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.9.3
apiVersion: v1
kind: Service
metadata:
name: weave-scope-app
labels:
name: weave-scope-app
app: weave-scope
weave-cloud-component: scope
weave-scope-component: app
namespace: weave
spec:
ports:
- name: app
port: 80
protocol: TCP
targetPort: 4040
selector:
name: weave-scope-app
app: weave-scope
weave-cloud-component: scope
weave-scope-component: app