updating weave.cloud docs (#3910)

This commit is contained in:
Eneko Fernández
2022-10-06 16:15:07 +01:00
committed by GitHub
parent bc058a7038
commit 79a26df996
18 changed files with 315 additions and 40 deletions

View File

@@ -1,4 +1,3 @@
# borrowed from https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.10.0
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:

View File

@@ -1,5 +1,3 @@
# borrowed from https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.10.0
# with little modificatios to reduce permissions
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:

View File

@@ -1,4 +1,3 @@
# borrowed from https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.10.0
apiVersion: apps/v1
kind: Deployment
metadata:

View File

@@ -1,4 +1,3 @@
# borrowed from https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.10.0
apiVersion: apps/v1
kind: DaemonSet
metadata:

View File

@@ -1,4 +1,3 @@
# borrowed from https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.10.0
apiVersion: v1
kind: Namespace
metadata:

View File

@@ -1,4 +1,3 @@
# borrowed from https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.10.0
apiVersion: v1
kind: ServiceAccount
metadata:

View File

@@ -1,4 +1,3 @@
# borrowed from https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.10.0
apiVersion: v1
kind: Service
metadata:

313
examples/k8s-scope.yaml Normal file
View File

@@ -0,0 +1,313 @@
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: Namespace
metadata:
name: weave
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
name: weave-scope
name: weave-scope
namespace: weave
rules:
- apiGroups:
- ""
resources:
- pods
- pods/log
- replicationcontrollers
- services
- namespaces
- persistentvolumes
- persistentvolumeclaims
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- pods
verbs:
- delete
- apiGroups:
- apps
resources:
- deployments
- statefulsets
- daemonsets
verbs:
- get
- list
- watch
- apiGroups:
- batch
resources:
- cronjobs
- jobs
verbs:
- get
- list
- watch
- apiGroups:
- extensions
resources:
- daemonsets
- deployments
- deployments/scale
- replicasets
verbs:
- get
- list
- watch
- apiGroups:
- extensions
resources:
- deployments/scale
verbs:
- update
- apiGroups:
- apps
resources:
- deployments/scale
verbs:
- get
- update
- apiGroups:
- storage.k8s.io
resources:
- storageclasses
verbs:
- list
- watch
- apiGroups:
- extensions
resourceNames:
- weave-scope
resources:
- podsecuritypolicies
verbs:
- use
- apiGroups:
- volumesnapshot.external-storage.k8s.io
resources:
- volumesnapshots
- volumesnapshotdatas
verbs:
- list
- watch
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- update
- patch
- 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
- 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
selector:
matchLabels:
app: weave-scope
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.13.2
imagePullPolicy: IfNotPresent
ports:
- containerPort: 4040
protocol: TCP
resources:
requests:
cpu: 200m
memory: 200Mi
- 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
selector:
matchLabels:
app: weave-scope
template:
metadata:
labels:
name: weave-scope-agent
app: weave-scope
weave-cloud-component: scope
weave-scope-component: agent
spec:
containers:
- name: scope-agent
args:
- '--mode=probe'
- '--probe-only'
- '--probe.kubernetes.role=host'
- '--probe.docker.bridge=docker0'
- '--probe.docker=true'
- 'weave-scope-app.weave.svc.cluster.local.:80'
env:
- name: SCOPE_HOSTNAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: weaveworks/scope:1.13.2
imagePullPolicy: IfNotPresent
resources:
requests:
cpu: 100m
memory: 100Mi
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
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
- apiVersion: apps/v1
kind: Deployment
metadata:
name: weave-scope-cluster-agent
labels:
name: weave-scope-cluster-agent
app: weave-scope
weave-cloud-component: scope
weave-scope-component: cluster-agent
namespace: weave
spec:
replicas: 1
selector:
matchLabels:
name: weave-scope-cluster-agent
app: weave-scope
weave-cloud-component: scope
weave-scope-component: cluster-agent
revisionHistoryLimit: 2
template:
metadata:
labels:
name: weave-scope-cluster-agent
app: weave-scope
weave-cloud-component: scope
weave-scope-component: cluster-agent
spec:
containers:
- name: scope-cluster-agent
args:
- '--mode=probe'
- '--probe-only'
- '--probe.kubernetes.role=cluster'
- 'weave-scope-app.weave.svc.cluster.local.:80'
command:
- /home/weave/scope
image: 'docker.io/weaveworks/scope:1.13.2'
imagePullPolicy: IfNotPresent
resources:
requests:
cpu: 100m
memory: 100Mi
volumeMounts:
- name: scope-plugins
mountPath: /var/run/scope/plugins
serviceAccountName: weave-scope
volumes:
- name: scope-plugins
hostPath:
path: /var/run/scope/plugins
- apiVersion: v1
kind: ServiceAccount
metadata:
name: weave-scope
labels:
name: weave-scope
namespace: weave
- 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

View File

@@ -1,4 +1,3 @@
# borrowed from https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.9.3
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:

View File

@@ -1,5 +1,3 @@
# 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:

View File

@@ -1,4 +1,3 @@
# borrowed from https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.9.3
apiVersion: apps/v1
kind: Deployment
metadata:

View File

@@ -1,4 +1,3 @@
# borrowed from https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.9.3
apiVersion: apps/v1
kind: DaemonSet
metadata:

View File

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

View File

@@ -1,4 +1,3 @@
# borrowed from https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.9.3
apiVersion: apps/v1
kind: Deployment
metadata:

View File

@@ -1,21 +0,0 @@
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: weave-scope
spec:
privileged: true
hostPID: true
hostNetwork: true
allowedCapabilities:
- 'NET_ADMIN'
fsGroup:
rule: RunAsAny
runAsUser:
rule: RunAsAny
seLinux:
rule: RunAsAny
supplementalGroups:
rule: RunAsAny
volumes:
- secret
- hostPath

View File

@@ -1,4 +1,3 @@
# borrowed from https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.9.3
apiVersion: v1
kind: ServiceAccount
metadata:

View File

@@ -1,4 +1,3 @@
# borrowed from https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.9.3
apiVersion: v1
kind: Service
metadata:

View File

@@ -152,7 +152,7 @@ Version 2 of this YAML file supports networks and volumes as defined by any plug
To install Weave Scope on your Kubernetes cluster, run
kubectl apply -f "https://cloud.weave.works/k8s/scope.yaml?k8s-version=$(kubectl version | base64 | tr -d '\n')"
kubectl apply -f https://github.com/weaveworks/scope/releases/download/v1.13.2/k8s-scope.yaml
This downloads a recent Scope image from Dockerhub and launches a probe onto every node as well as a single Scope app. Once launched, Scope doesnt require any other configuration.
@@ -221,7 +221,7 @@ Next, create a dedicated project for Weave Scope then apply policy changes neede
The installation method for Scope on OpenShift is very similar to the one described [above](#k8s) for Kubernetes, but instead of `kubectl apply ...` you need to use
`oc apply ...` and install it into the namespace of the `weave` project you have just created, and not the `weave` namespace, i.e.:
oc apply -f 'https://cloud.weave.works/k8s/scope.yaml'
oc apply -f 'https://github.com/weaveworks/scope/releases/download/v1.13.2/k8s-scope.yaml'
To access the Scope app from the browser, please refer to Kubernetes instructions [above](#k8s).