-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4581 from itskingori/add_metrics_server_addon
Add metrics-server addon
- Loading branch information
Showing
4 changed files
with
248 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Kubernetes Metrics Server | ||
|
||
Compatibility matrix: | ||
|
||
Metrics Server | Metrics API group/version | Supported Kubernetes version | ||
---------------|---------------------------|----------------------------- | ||
0.2.x | `metrics.k8s.io/v1beta1` | 1.8+ | ||
0.1.x | `metrics/v1alpha1` | 1.7 | ||
|
||
|
||
In order to deploy metrics-server in your cluster run the following command from | ||
the top-level directory of this repository: | ||
|
||
```console | ||
# Kubernetes 1.7 | ||
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/kops/master/addons/metrics-server/v1.7.x.yaml | ||
|
||
# Kubernetes 1.8+ | ||
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/kops/master/addons/metrics-server/v1.8.x.yaml | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: metrics-server | ||
namespace: kube-system | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: metrics-server:system:auth-delegator | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: system:auth-delegator | ||
subjects: | ||
- kind: ServiceAccount | ||
name: metrics-server | ||
namespace: kube-system | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: RoleBinding | ||
metadata: | ||
name: metrics-server-auth-reader | ||
namespace: kube-system | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: extension-apiserver-authentication-reader | ||
subjects: | ||
- kind: ServiceAccount | ||
name: metrics-server | ||
namespace: kube-system | ||
--- | ||
apiVersion: apiregistration.k8s.io/v1beta1 | ||
kind: APIService | ||
metadata: | ||
name: v1alpha1.metrics | ||
spec: | ||
service: | ||
name: metrics-server | ||
namespace: kube-system | ||
group: metrics | ||
version: v1alpha1 | ||
insecureSkipTLSVerify: true | ||
groupPriorityMinimum: 100 | ||
versionPriority: 100 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: metrics-server | ||
namespace: kube-system | ||
labels: | ||
kubernetes.io/name: "Metrics-server" | ||
spec: | ||
selector: | ||
k8s-app: metrics-server | ||
ports: | ||
- port: 443 | ||
protocol: TCP | ||
targetPort: 443 | ||
--- | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: metrics-server | ||
namespace: kube-system | ||
labels: | ||
k8s-app: metrics-server | ||
spec: | ||
selector: | ||
matchLabels: | ||
k8s-app: metrics-server | ||
template: | ||
metadata: | ||
name: metrics-server | ||
labels: | ||
k8s-app: metrics-server | ||
spec: | ||
serviceAccountName: metrics-server | ||
containers: | ||
- name: metrics-server | ||
image: gcr.io/google_containers/metrics-server-amd64:v0.1.0 | ||
imagePullPolicy: Always | ||
command: | ||
- /metrics-server | ||
- --source=kubernetes.summary_api:'' | ||
resources: | ||
requests: | ||
cpu: 20m | ||
memory: 200Mi | ||
limits: | ||
cpu: 100m | ||
memory: 500Mi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: metrics-server | ||
namespace: kube-system | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: metrics-server:system:auth-delegator | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: system:auth-delegator | ||
subjects: | ||
- kind: ServiceAccount | ||
name: metrics-server | ||
namespace: kube-system | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: metrics-server-auth-reader | ||
namespace: kube-system | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: extension-apiserver-authentication-reader | ||
subjects: | ||
- kind: ServiceAccount | ||
name: metrics-server | ||
namespace: kube-system | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: system:metrics-server | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
- nodes | ||
- namespaces | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- "extensions" | ||
resources: | ||
- deployments | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: system:metrics-server | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: system:metrics-server | ||
subjects: | ||
- kind: ServiceAccount | ||
name: metrics-server | ||
namespace: kube-system | ||
--- | ||
apiVersion: apiregistration.k8s.io/v1beta1 | ||
kind: APIService | ||
metadata: | ||
name: v1beta1.metrics.k8s.io | ||
spec: | ||
service: | ||
name: metrics-server | ||
namespace: kube-system | ||
group: metrics.k8s.io | ||
version: v1beta1 | ||
insecureSkipTLSVerify: true | ||
groupPriorityMinimum: 100 | ||
versionPriority: 100 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: metrics-server | ||
namespace: kube-system | ||
labels: | ||
kubernetes.io/name: "Metrics-server" | ||
spec: | ||
selector: | ||
k8s-app: metrics-server | ||
ports: | ||
- port: 443 | ||
protocol: TCP | ||
targetPort: 443 | ||
--- | ||
apiVersion: apps/v1beta2 | ||
kind: Deployment | ||
metadata: | ||
name: metrics-server | ||
namespace: kube-system | ||
labels: | ||
k8s-app: metrics-server | ||
spec: | ||
selector: | ||
matchLabels: | ||
k8s-app: metrics-server | ||
template: | ||
metadata: | ||
name: metrics-server | ||
labels: | ||
k8s-app: metrics-server | ||
spec: | ||
serviceAccountName: metrics-server | ||
containers: | ||
- name: metrics-server | ||
image: gcr.io/google_containers/metrics-server-amd64:v0.2.1 | ||
imagePullPolicy: Always | ||
command: | ||
- /metrics-server | ||
- --source=kubernetes.summary_api:'' | ||
resources: | ||
requests: | ||
cpu: 20m | ||
memory: 200Mi | ||
limits: | ||
cpu: 100m | ||
memory: 500Mi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters