From 8ff2e3985b99598bc1513fa8c967c3d64ebc5024 Mon Sep 17 00:00:00 2001 From: Taner Sener Date: Mon, 4 Jan 2021 13:11:33 +0000 Subject: [PATCH] keep non-helm deployment files Signed-off-by: Taner Sener --- docs/custom-metrics-apiservice.yaml | 13 ++ docs/deployment.yaml | 40 +++++ docs/external-metrics-apiservice.yaml | 13 ++ {helm => docs/helm}/Chart.yaml | 0 .../templates/custom-metrics-apiservice.yaml | 0 {helm => docs/helm}/templates/deployment.yaml | 0 .../external-metrics-apiservice.yaml | 0 {helm => docs/helm}/templates/rbac.yaml | 0 .../helm}/templates/service-account.yaml | 0 {helm => docs/helm}/templates/service.yaml | 0 {helm => docs/helm}/values.yaml | 0 docs/rbac.yaml | 146 ++++++++++++++++++ docs/service.yaml | 11 ++ 13 files changed, 223 insertions(+) create mode 100644 docs/custom-metrics-apiservice.yaml create mode 100644 docs/deployment.yaml create mode 100644 docs/external-metrics-apiservice.yaml rename {helm => docs/helm}/Chart.yaml (100%) rename {helm => docs/helm}/templates/custom-metrics-apiservice.yaml (100%) rename {helm => docs/helm}/templates/deployment.yaml (100%) rename {helm => docs/helm}/templates/external-metrics-apiservice.yaml (100%) rename {helm => docs/helm}/templates/rbac.yaml (100%) rename {helm => docs/helm}/templates/service-account.yaml (100%) rename {helm => docs/helm}/templates/service.yaml (100%) rename {helm => docs/helm}/values.yaml (100%) create mode 100644 docs/rbac.yaml create mode 100644 docs/service.yaml diff --git a/docs/custom-metrics-apiservice.yaml b/docs/custom-metrics-apiservice.yaml new file mode 100644 index 0000000..5df1876 --- /dev/null +++ b/docs/custom-metrics-apiservice.yaml @@ -0,0 +1,13 @@ +apiVersion: apiregistration.k8s.io/v1beta1 +kind: APIService +metadata: + name: v1beta1.custom.metrics.k8s.io +spec: + service: + name: kube-metrics-adapter + namespace: kube-system + group: custom.metrics.k8s.io + version: v1beta1 + insecureSkipTLSVerify: true + groupPriorityMinimum: 100 + versionPriority: 100 diff --git a/docs/deployment.yaml b/docs/deployment.yaml new file mode 100644 index 0000000..8b25bc9 --- /dev/null +++ b/docs/deployment.yaml @@ -0,0 +1,40 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: kube-metrics-adapter + namespace: kube-system + labels: + application: kube-metrics-adapter + version: latest +spec: + replicas: 1 + selector: + matchLabels: + application: kube-metrics-adapter + template: + metadata: + labels: + application: kube-metrics-adapter + version: latest + annotations: + iam.amazonaws.com/role: "kube-aws-test-1-app-zmon" + spec: + serviceAccountName: custom-metrics-apiserver + containers: + - name: kube-metrics-adapter + image: registry.opensource.zalan.do/teapot/kube-metrics-adapter:latest + args: + # - --v=9 + - --prometheus-server=http://prometheus.kube-system.svc.cluster.local + - --skipper-ingress-metrics + - --aws-external-metrics + env: + - name: AWS_REGION + value: eu-central-1 + resources: + limits: + cpu: 100m + memory: 100Mi + requests: + cpu: 100m + memory: 100Mi diff --git a/docs/external-metrics-apiservice.yaml b/docs/external-metrics-apiservice.yaml new file mode 100644 index 0000000..e43784f --- /dev/null +++ b/docs/external-metrics-apiservice.yaml @@ -0,0 +1,13 @@ +apiVersion: apiregistration.k8s.io/v1beta1 +kind: APIService +metadata: + name: v1beta1.external.metrics.k8s.io +spec: + service: + name: kube-metrics-adapter + namespace: kube-system + group: external.metrics.k8s.io + version: v1beta1 + insecureSkipTLSVerify: true + groupPriorityMinimum: 100 + versionPriority: 100 diff --git a/helm/Chart.yaml b/docs/helm/Chart.yaml similarity index 100% rename from helm/Chart.yaml rename to docs/helm/Chart.yaml diff --git a/helm/templates/custom-metrics-apiservice.yaml b/docs/helm/templates/custom-metrics-apiservice.yaml similarity index 100% rename from helm/templates/custom-metrics-apiservice.yaml rename to docs/helm/templates/custom-metrics-apiservice.yaml diff --git a/helm/templates/deployment.yaml b/docs/helm/templates/deployment.yaml similarity index 100% rename from helm/templates/deployment.yaml rename to docs/helm/templates/deployment.yaml diff --git a/helm/templates/external-metrics-apiservice.yaml b/docs/helm/templates/external-metrics-apiservice.yaml similarity index 100% rename from helm/templates/external-metrics-apiservice.yaml rename to docs/helm/templates/external-metrics-apiservice.yaml diff --git a/helm/templates/rbac.yaml b/docs/helm/templates/rbac.yaml similarity index 100% rename from helm/templates/rbac.yaml rename to docs/helm/templates/rbac.yaml diff --git a/helm/templates/service-account.yaml b/docs/helm/templates/service-account.yaml similarity index 100% rename from helm/templates/service-account.yaml rename to docs/helm/templates/service-account.yaml diff --git a/helm/templates/service.yaml b/docs/helm/templates/service.yaml similarity index 100% rename from helm/templates/service.yaml rename to docs/helm/templates/service.yaml diff --git a/helm/values.yaml b/docs/helm/values.yaml similarity index 100% rename from helm/values.yaml rename to docs/helm/values.yaml diff --git a/docs/rbac.yaml b/docs/rbac.yaml new file mode 100644 index 0000000..6bfc7e9 --- /dev/null +++ b/docs/rbac.yaml @@ -0,0 +1,146 @@ +kind: ServiceAccount +apiVersion: v1 +metadata: + name: custom-metrics-apiserver + namespace: kube-system +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: custom-metrics-server-resources +rules: +- apiGroups: + - custom.metrics.k8s.io + resources: ["*"] + verbs: ["*"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: external-metrics-server-resources +rules: +- apiGroups: + - external.metrics.k8s.io + resources: ["*"] + verbs: ["*"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: custom-metrics-resource-reader +rules: +- apiGroups: + - "" + resources: + - namespaces + - pods + - services + verbs: + - get + - list +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: custom-metrics-resource-collector +rules: +- apiGroups: + - "" + resources: + - events + verbs: + - create + - patch +- apiGroups: + - "" + resources: + - pods + verbs: + - list +- apiGroups: + - apps + resources: + - deployments + - statefulsets + verbs: + - get +- apiGroups: + - extensions + resources: + - ingresses + verbs: + - get +- apiGroups: + - autoscaling + resources: + - horizontalpodautoscalers + verbs: + - get + - list + - watch +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: hpa-controller-custom-metrics +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: custom-metrics-server-resources +subjects: +- kind: ServiceAccount + name: horizontal-pod-autoscaler + namespace: kube-system +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: hpa-controller-external-metrics +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: external-metrics-server-resources +subjects: +- kind: ServiceAccount + name: horizontal-pod-autoscaler + namespace: kube-system +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: custom-metrics-auth-reader + namespace: kube-system +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: extension-apiserver-authentication-reader +subjects: +- kind: ServiceAccount + name: custom-metrics-apiserver + namespace: kube-system +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: custom-metrics:system:auth-delegator +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: system:auth-delegator +subjects: +- kind: ServiceAccount + name: custom-metrics-apiserver + namespace: kube-system +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: custom-metrics-resource-collector +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: custom-metrics-resource-collector +subjects: +- kind: ServiceAccount + name: custom-metrics-apiserver + namespace: kube-system diff --git a/docs/service.yaml b/docs/service.yaml new file mode 100644 index 0000000..b1a24f1 --- /dev/null +++ b/docs/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: kube-metrics-adapter + namespace: kube-system +spec: + ports: + - port: 443 + targetPort: 443 + selector: + application: kube-metrics-adapter