Skip to content

Commit

Permalink
protect openshift traffic
Browse files Browse the repository at this point in the history
Define dedicated flowschema and priority configuration that will
protect openshift specific traffic.

- SAR from oas is very important
- kcm, other oas requests, metrics requests from openshift-monitoring
  is pretty important
- control plane operators are important (kas-o, oas-o, auth operator,
  etcd operator)
- workloads-low goes below the traffic defined above.
  • Loading branch information
tkashem committed Oct 5, 2020
1 parent be4604a commit 9186ce2
Showing 1 changed file with 180 additions and 0 deletions.
180 changes: 180 additions & 0 deletions manifests/0000_20_kube-apiserver-operator_08_flowschema.yaml
@@ -0,0 +1,180 @@
apiVersion: flowcontrol.apiserver.k8s.io/v1alpha1
kind: PriorityLevelConfiguration
metadata:
name: openshift-aggregated-api-delegated-auth
spec:
limited:
assuredConcurrencyShares: 20
limitResponse:
queuing:
handSize: 6
queueLengthLimit: 50
queues: 16
type: Queue
type: Limited
---
apiVersion: flowcontrol.apiserver.k8s.io/v1alpha1
kind: PriorityLevelConfiguration
metadata:
name: openshift-control-plane-operators
spec:
limited:
assuredConcurrencyShares: 10
limitResponse:
queuing:
handSize: 6
queueLengthLimit: 50
queues: 128
type: Queue
type: Limited
---
apiVersion: flowcontrol.apiserver.k8s.io/v1alpha1
kind: FlowSchema
metadata:
name: openshift-apiserver-sar
spec:
distinguisherMethod:
type: ByUser
matchingPrecedence: 600
priorityLevelConfiguration:
name: openshift-aggregated-api-delegated-auth
rules:
- resourceRules:
- apiGroups:
- authorization.k8s.io
clusterScope: true
namespaces:
- '*'
resources:
- subjectaccessreviews
verbs:
- '*'
- apiGroups:
- authentication.k8s.io
clusterScope: true
namespaces:
- '*'
resources:
- tokenreviews
verbs:
- '*'
subjects:
- kind: ServiceAccount
serviceAccount:
name: openshift-apiserver-sa
namespace: openshift-apiserver
---
apiVersion: flowcontrol.apiserver.k8s.io/v1alpha1
kind: FlowSchema
metadata:
name: openshift-apiserver-other-requests
spec:
distinguisherMethod:
type: ByUser
matchingPrecedence: 1000
priorityLevelConfiguration:
name: workload-high
rules:
- resourceRules:
- apiGroups:
- '*'
clusterScope: true
namespaces:
- '*'
resources:
- '*'
verbs:
- '*'
subjects:
- kind: ServiceAccount
serviceAccount:
name: openshift-apiserver-sa
namespace: openshift-apiserver
---
apiVersion: flowcontrol.apiserver.k8s.io/v1alpha1
kind: FlowSchema
metadata:
name: openshift-controller-manager
spec:
distinguisherMethod:
type: ByUser
matchingPrecedence: 1000
priorityLevelConfiguration:
name: workload-high
rules:
- resourceRules:
- apiGroups:
- '*'
clusterScope: true
namespaces:
- '*'
resources:
- '*'
verbs:
- '*'
subjects:
- kind: ServiceAccount
serviceAccount:
name: openshift-controller-manager-sa
namespace: openshift-controller-manager
---
apiVersion: flowcontrol.apiserver.k8s.io/v1alpha1
kind: FlowSchema
metadata:
name: openshift-monitoring-metrics
spec:
distinguisherMethod:
type: ByUser
matchingPrecedence: 2000
priorityLevelConfiguration:
name: workload-high
rules:
- nonResourceRules:
- verbs:
- '*'
nonResourceURLs:
- "/metrics"
subjects:
- kind: ServiceAccount
serviceAccount:
name: prometheus-k8s
namespace: openshift-monitoring
---
apiVersion: flowcontrol.apiserver.k8s.io/v1alpha1
kind: FlowSchema
metadata:
name: openshift-control-plane-operators
spec:
distinguisherMethod:
type: ByUser
matchingPrecedence: 2000
priorityLevelConfiguration:
name: openshift-control-plane-operators
rules:
- resourceRules:
- apiGroups:
- '*'
clusterScope: true
namespaces:
- '*'
resources:
- '*'
verbs:
- '*'
subjects:
- kind: ServiceAccount
serviceAccount:
name: kube-apiserver-operator
namespace: openshift-kube-apiserver-operator
- kind: ServiceAccount
serviceAccount:
name: openshift-apiserver-operator
namespace: openshift-apiserver-operator
- kind: ServiceAccount
serviceAccount:
name: authentication-operator
namespace: openshift-authentication-operator
- kind: ServiceAccount
serviceAccount:
name: etcd-operator
namespace: openshift-etcd-operator

0 comments on commit 9186ce2

Please sign in to comment.