diff --git a/Makefile b/Makefile index 76348ad..b59e231 100644 --- a/Makefile +++ b/Makefile @@ -3,5 +3,6 @@ CHARTS = $(shell ls -d */ | grep -v charts) package: + $(foreach var,$(CHARTS),helm dep update $(var);) helm package $(CHARTS) -d charts helm repo index charts --merge charts/index.yaml diff --git a/charts/efk-0.1.0.tgz b/charts/efk-0.1.0.tgz index 828bc27..455ea07 100644 Binary files a/charts/efk-0.1.0.tgz and b/charts/efk-0.1.0.tgz differ diff --git a/charts/hpa-operator-0.0.5.tgz b/charts/hpa-operator-0.0.5.tgz new file mode 100644 index 0000000..2f8c2e5 Binary files /dev/null and b/charts/hpa-operator-0.0.5.tgz differ diff --git a/charts/index.yaml b/charts/index.yaml index 1fb78a7..63e60a1 100755 --- a/charts/index.yaml +++ b/charts/index.yaml @@ -3,7 +3,7 @@ entries: descheduler: - apiVersion: v1 appVersion: v0.6.0 - created: 2018-09-12T15:45:03.41716471+02:00 + created: 2018-09-30T16:35:22.592860799+02:00 description: A Helm chart for Kubernetes Descheduler digest: 9eddad77998b3d4632375bfb0b9a133bde4e4a47beaf57422aee4cba4db0d73d name: descheduler @@ -12,7 +12,7 @@ entries: version: 0.2.0 - apiVersion: v1 appVersion: v0.5.0-4-ga7ceb671 - created: 2018-09-12T15:45:03.416727347+02:00 + created: 2018-09-30T16:35:22.592594243+02:00 description: A Helm chart for Kubernetes Descheduler digest: 32ca0684f33dbfe61f265537e3c87d04c43e7ac9aafeb77f44397cbaa32f6bae name: descheduler @@ -22,9 +22,9 @@ entries: efk: - apiVersion: v1 appVersion: "1.0" - created: 2018-09-12T15:45:03.41927062+02:00 + created: 2018-09-30T16:35:22.593884356+02:00 description: A Helm chart for EFK stack - digest: caef9bf0810a510360aa2f7d10f6f3a0d8dba92d6a1d98d56a5ef4df3bf8d6bb + digest: e918ad64c644cf3148430c0aea4430a73a7aecc9f99bba83f1cf05661c728fed name: efk urls: - efk-0.1.0.tgz @@ -32,7 +32,7 @@ entries: elasticsearch: - apiVersion: v1 appVersion: 6.1.3 - created: 2018-09-12T15:45:03.420802181+02:00 + created: 2018-09-30T16:35:22.59488509+02:00 description: A Helm chart for Elasticsearch cluster digest: eb8163d9a2153c5760e80b530a4ff8653c569b24a3cffd26a1f1be8a4e080179 maintainers: @@ -47,7 +47,7 @@ entries: version: 0.1.4 - apiVersion: v1 appVersion: 6.1.3 - created: 2018-09-12T15:45:03.420339349+02:00 + created: 2018-09-30T16:35:22.594621314+02:00 description: A Helm chart for Elasticsearch cluster digest: 32a25b05c73cc92b49fc53b64d25cee44d28e1062db1ef12f2cbcb0e260d0019 maintainers: @@ -63,7 +63,7 @@ entries: elasticsearch-operator: - apiVersion: v1 appVersion: 0.0.12 - created: 2018-09-12T15:45:03.423102475+02:00 + created: 2018-09-30T16:35:22.596354056+02:00 description: A Helm chart for Elasticsearch operator digest: 5b946ae9c69685e80964599cadfcf1b675b124eb393471ee0f335e63eb572024 maintainers: @@ -78,7 +78,7 @@ entries: version: 0.1.5 - apiVersion: v1 appVersion: 0.0.12 - created: 2018-09-12T15:45:03.422653561+02:00 + created: 2018-09-30T16:35:22.596090944+02:00 description: A Helm chart for Elasticsearch operator digest: f909a7a19ec3e04259a40728c7428515701aed1f8cae7407c8b6a993b6e083d8 maintainers: @@ -93,7 +93,7 @@ entries: version: 0.1.4 - apiVersion: v1 appVersion: 0.0.10 - created: 2018-09-12T15:45:03.421771749+02:00 + created: 2018-09-30T16:35:22.595426278+02:00 description: A Helm chart for Elasticsearch operator digest: dea5f18a301f11dee2aef9ac1dd3b44069e4bc128c8c32f8e1322a55a385a282 maintainers: @@ -106,10 +106,28 @@ entries: urls: - elasticsearch-operator-0.1.3.tgz version: 0.1.3 + hpa-operator: + - created: 2018-09-30T16:35:22.596804003+02:00 + description: A Helm chart for Kubernetes + digest: 5ebfbb9595d4cd83bea6be1f025c39d4d4c37381cf03a1e4520e52007a1176e3 + home: https://banzaicloud.com + keywords: + - hpa + - autoscale + maintainers: + - email: alen.komljen@live.com + name: komljen + url: https://akomljen.com + name: hpa-operator + sources: + - https://github.com/banzaicloud/hpa-operator + urls: + - hpa-operator-0.0.5.tgz + version: 0.0.5 k8s-spot-rescheduler: - apiVersion: v1 appVersion: v0.2.0 - created: 2018-09-12T15:45:03.4247439+02:00 + created: 2018-09-30T16:35:22.598047392+02:00 description: A k8s-spot-rescheduler Helm chart for Kubernetes digest: efa17ca0d214dd037427682b8096ab8c47ffa9160e2f0abb490121900cf4db53 home: https://github.com/pusher/k8s-spot-rescheduler @@ -127,7 +145,7 @@ entries: version: 0.3.0 - apiVersion: v1 appVersion: v0.1.1 - created: 2018-09-12T15:45:03.424194744+02:00 + created: 2018-09-30T16:35:22.597706198+02:00 description: A k8s-spot-rescheduler Helm chart for Kubernetes digest: 255c56c1e35296a45dee14e8d069210a3c8ef4865b44b01b2378f3b8c1423bd2 home: https://github.com/pusher/k8s-spot-rescheduler @@ -145,7 +163,7 @@ entries: version: 0.2.0 kibana: - appVersion: 6.1.3 - created: 2018-09-12T15:45:03.425361346+02:00 + created: 2018-09-30T16:35:22.598428553+02:00 description: Kibana is an open source data visualization plugin for Elasticsearch digest: 17482b8ec6895ab271666a834223554857490c36acc449e87b2ba4b134b3e704 engine: gotpl @@ -165,4 +183,23 @@ entries: urls: - kibana-0.4.2.tgz version: 0.4.2 -generated: 2018-09-12T15:45:03.415471275+02:00 + metrics-server: + - apiVersion: v1 + appVersion: 0.3.1 + created: 2018-09-30T16:35:22.598743009+02:00 + description: Metrics Server is a cluster-wide aggregator of resource usage data. + digest: 9e665061a94a0379ab564500b4ffaee8098f3b252cf25fc231d75242df99cad5 + home: https://github.com/kubernetes-incubator/metrics-server + keywords: + - metrics-server + maintainers: + - email: alen.komljen@live.com + name: komljen + url: https://akomljen.com + name: metrics-server + sources: + - https://github.com/kubernetes-incubator/metrics-server + urls: + - metrics-server-0.0.5.tgz + version: 0.0.5 +generated: 2018-09-30T16:35:22.591718511+02:00 diff --git a/charts/metrics-server-0.0.5.tgz b/charts/metrics-server-0.0.5.tgz new file mode 100644 index 0000000..030890d Binary files /dev/null and b/charts/metrics-server-0.0.5.tgz differ diff --git a/hpa-operator/.helmignore b/hpa-operator/.helmignore new file mode 100644 index 0000000..f0c1319 --- /dev/null +++ b/hpa-operator/.helmignore @@ -0,0 +1,21 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/hpa-operator/Chart.yaml b/hpa-operator/Chart.yaml new file mode 100644 index 0000000..58537a6 --- /dev/null +++ b/hpa-operator/Chart.yaml @@ -0,0 +1,13 @@ +name: hpa-operator +version: 0.0.5 +description: A Helm chart for Kubernetes +home: https://banzaicloud.com +sources: + - https://github.com/banzaicloud/hpa-operator +keywords: +- hpa +- autoscale +maintainers: +- name: komljen + email: alen.komljen@live.com + url: https://akomljen.com diff --git a/hpa-operator/charts/metrics-server-0.0.5.tgz b/hpa-operator/charts/metrics-server-0.0.5.tgz new file mode 100644 index 0000000..030890d Binary files /dev/null and b/hpa-operator/charts/metrics-server-0.0.5.tgz differ diff --git a/hpa-operator/requirements.lock b/hpa-operator/requirements.lock new file mode 100644 index 0000000..e1d65f9 --- /dev/null +++ b/hpa-operator/requirements.lock @@ -0,0 +1,6 @@ +dependencies: +- name: metrics-server + repository: file://../metrics-server + version: 0.0.5 +digest: sha256:d370ab37cdf2842869d08e8e9e743e99e2e3d75f0206a41b735f19a7466ecd6c +generated: 2018-09-30T16:31:50.185598231+02:00 diff --git a/hpa-operator/requirements.yaml b/hpa-operator/requirements.yaml new file mode 100644 index 0000000..6abb18e --- /dev/null +++ b/hpa-operator/requirements.yaml @@ -0,0 +1,7 @@ +dependencies: +- name: metrics-server + version: "0.0.5" + repository: https://raw.githubusercontent.com/komljen/helm-charts/master/charts/ + # repository: file://../metrics-server + condition: metricsServer.enabled + diff --git a/hpa-operator/templates/_helpers.tpl b/hpa-operator/templates/_helpers.tpl new file mode 100644 index 0000000..9282e7c --- /dev/null +++ b/hpa-operator/templates/_helpers.tpl @@ -0,0 +1,43 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "hpa-operator.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "hpa-operator.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "hpa-operator.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "hpa-operator.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "hpa-operator.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/hpa-operator/templates/clusterrole.yaml b/hpa-operator/templates/clusterrole.yaml new file mode 100644 index 0000000..80ad71f --- /dev/null +++ b/hpa-operator/templates/clusterrole.yaml @@ -0,0 +1,40 @@ +{{- if .Values.rbac.create }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ template "hpa-operator.fullname" . }} + labels: + app: {{ template "hpa-operator.name" . }} + chart: {{ template "hpa-operator.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +rules: +- apiGroups: + - banzaicloud.com + resources: + - "*" + verbs: + - "*" +- apiGroups: + - "" + resources: + - pods + - events + verbs: + - "*" +- apiGroups: + - apps + resources: + - deployments + - daemonsets + - replicasets + - statefulsets + verbs: + - "*" +- apiGroups: + - autoscaling + resources: + - '*' + verbs: + - '*' +{{- end }} diff --git a/hpa-operator/templates/clusterrolebinding.yaml b/hpa-operator/templates/clusterrolebinding.yaml new file mode 100644 index 0000000..3b69d63 --- /dev/null +++ b/hpa-operator/templates/clusterrolebinding.yaml @@ -0,0 +1,19 @@ +{{- if .Values.rbac.create }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ template "hpa-operator.fullname" . }} + labels: + app: {{ template "hpa-operator.name" . }} + chart: {{ template "hpa-operator.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ template "hpa-operator.fullname" . }} +subjects: +- kind: ServiceAccount + name: {{ template "hpa-operator.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +{{- end }} diff --git a/hpa-operator/templates/deployment.yaml b/hpa-operator/templates/deployment.yaml new file mode 100644 index 0000000..c849e19 --- /dev/null +++ b/hpa-operator/templates/deployment.yaml @@ -0,0 +1,31 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ template "hpa-operator.fullname" . }} + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + app: "{{ template "hpa-operator.fullname" . }}" + heritage: "{{ .Release.Service }}" + release: "{{ .Release.Name }}" +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: "{{ template "hpa-operator.fullname" . }}" + template: + metadata: + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + app: {{ template "hpa-operator.fullname" . }} + heritage: "{{ .Release.Service }}" + release: "{{ .Release.Name }}" + spec: + serviceAccountName: {{ template "hpa-operator.serviceAccountName" . }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + command: + - hpa-operator + resources: +{{ toYaml .Values.resources | indent 12 }} diff --git a/hpa-operator/templates/serviceaccount.yaml b/hpa-operator/templates/serviceaccount.yaml new file mode 100644 index 0000000..2cf3bae --- /dev/null +++ b/hpa-operator/templates/serviceaccount.yaml @@ -0,0 +1,11 @@ +{{- if .Values.serviceAccount.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ template "hpa-operator.serviceAccountName" . }} + labels: + app: {{ template "hpa-operator.name" . }} + chart: {{ template "hpa-operator.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- end }} diff --git a/hpa-operator/values.yaml b/hpa-operator/values.yaml new file mode 100755 index 0000000..c886c59 --- /dev/null +++ b/hpa-operator/values.yaml @@ -0,0 +1,28 @@ +# Default values for elasticsearch-operator. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +image: + repository: banzaicloud/hpa-operator + tag: 0.1.4 + pullPolicy: IfNotPresent + +resources: + limits: + cpu: 100m + memory: 128Mi + requests: + cpu: 100m + memory: 128Mi + +rbac: + create: true + +serviceAccount: + # Specifies whether a ServiceAccount should be created + create: true + # The name of the ServiceAccount to use. + # If not set and create is true, a name is generated using the fullname template + name: + +metricsServer: + enabled: true diff --git a/metrics-server/.helmignore b/metrics-server/.helmignore new file mode 100644 index 0000000..f0c1319 --- /dev/null +++ b/metrics-server/.helmignore @@ -0,0 +1,21 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/metrics-server/Chart.yaml b/metrics-server/Chart.yaml new file mode 100755 index 0000000..1ba6773 --- /dev/null +++ b/metrics-server/Chart.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +appVersion: 0.3.1 +description: Metrics Server is a cluster-wide aggregator of resource usage data. +name: metrics-server +version: 0.0.5 +keywords: +- metrics-server +home: https://github.com/kubernetes-incubator/metrics-server +sources: +- https://github.com/kubernetes-incubator/metrics-server +maintainers: +- name: komljen + email: alen.komljen@live.com + url: https://akomljen.com diff --git a/metrics-server/templates/NOTES.txt b/metrics-server/templates/NOTES.txt new file mode 100644 index 0000000..1034c12 --- /dev/null +++ b/metrics-server/templates/NOTES.txt @@ -0,0 +1,11 @@ +The metric server has been deployed. +{{ if .Values.apiService.create }} +In a few minutes you should be able to list metrics using the following +command: + + kubectl get --raw "/apis/metrics.k8s.io/v1beta1/nodes" +{{ else }} +NOTE: You have disabled the API service creation for this release. The metrics +API will not work with this release unless you configure the metrics API +service outside of this Helm chart. +{{- end -}} diff --git a/metrics-server/templates/_helpers.tpl b/metrics-server/templates/_helpers.tpl new file mode 100644 index 0000000..7654d6b --- /dev/null +++ b/metrics-server/templates/_helpers.tpl @@ -0,0 +1,43 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "metrics-server.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "metrics-server.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "metrics-server.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "metrics-server.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "metrics-server.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/metrics-server/templates/apiservice.yaml b/metrics-server/templates/apiservice.yaml new file mode 100644 index 0000000..552ffea --- /dev/null +++ b/metrics-server/templates/apiservice.yaml @@ -0,0 +1,20 @@ +{{- if .Values.apiService.create -}} +apiVersion: apiregistration.k8s.io/v1beta1 +kind: APIService +metadata: + name: v1beta1.metrics.k8s.io + labels: + app: {{ template "metrics-server.name" . }} + chart: {{ template "metrics-server.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + service: + name: {{ template "metrics-server.fullname" . }} + namespace: {{ .Release.Namespace }} + group: metrics.k8s.io + version: v1beta1 + insecureSkipTLSVerify: true + groupPriorityMinimum: 100 + versionPriority: 100 +{{- end -}} diff --git a/metrics-server/templates/clusterrole.yaml b/metrics-server/templates/clusterrole.yaml new file mode 100644 index 0000000..06387ef --- /dev/null +++ b/metrics-server/templates/clusterrole.yaml @@ -0,0 +1,31 @@ +{{- if .Values.rbac.create }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ template "metrics-server.fullname" . }} + labels: + app: {{ template "metrics-server.name" . }} + chart: {{ template "metrics-server.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +rules: +- apiGroups: + - "" + resources: + - pods + - nodes + - nodes/stats + - namespaces + verbs: + - get + - list + - watch +- apiGroups: + - "extensions" + resources: + - deployments + verbs: + - get + - list + - watch +{{- end }} diff --git a/metrics-server/templates/clusterrolebinding.yaml b/metrics-server/templates/clusterrolebinding.yaml new file mode 100644 index 0000000..2f22cda --- /dev/null +++ b/metrics-server/templates/clusterrolebinding.yaml @@ -0,0 +1,19 @@ +{{- if .Values.rbac.create }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ template "metrics-server.fullname" . }} + labels: + app: {{ template "metrics-server.name" . }} + chart: {{ template "metrics-server.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ template "metrics-server.fullname" . }} +subjects: +- kind: ServiceAccount + name: {{ template "metrics-server.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +{{- end }} diff --git a/metrics-server/templates/deployment.yaml b/metrics-server/templates/deployment.yaml new file mode 100644 index 0000000..3baea3e --- /dev/null +++ b/metrics-server/templates/deployment.yaml @@ -0,0 +1,36 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ template "metrics-server.fullname" . }} + labels: + app: {{ template "metrics-server.name" . }} + chart: {{ template "metrics-server.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + selector: + matchLabels: + app: {{ template "metrics-server.name" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ template "metrics-server.name" . }} + release: {{ .Release.Name }} + spec: + serviceAccountName: {{ template "metrics-server.serviceAccountName" . }} + volumes: + # mount in tmp so we can safely use from-scratch images and/or read-only containers + - name: tmp-dir + emptyDir: {} + containers: + - name: metrics-server + command: + - /metrics-server + - --kubelet-insecure-tls + - --kubelet-preferred-address-types=InternalIP + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: "{{ .Values.image.pullPolicy }}" + volumeMounts: + - name: tmp-dir + mountPath: /tmp diff --git a/metrics-server/templates/rolebinding.yaml b/metrics-server/templates/rolebinding.yaml new file mode 100644 index 0000000..7938121 --- /dev/null +++ b/metrics-server/templates/rolebinding.yaml @@ -0,0 +1,19 @@ +{{- if .Values.rbac.create }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ template "metrics-server.fullname" . }} + labels: + app: {{ template "metrics-server.name" . }} + chart: {{ template "metrics-server.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ template "metrics-server.fullname" . }} +subjects: +- kind: ServiceAccount + name: {{ template "metrics-server.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +{{- end }} diff --git a/metrics-server/templates/service.yaml b/metrics-server/templates/service.yaml new file mode 100644 index 0000000..ddf03e1 --- /dev/null +++ b/metrics-server/templates/service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "metrics-server.fullname" . }} + labels: + app: {{ template "metrics-server.name" . }} + chart: {{ template "metrics-server.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + ports: + - port: 443 + protocol: TCP + targetPort: 443 + selector: + app: {{ template "metrics-server.name" . }} + release: {{ .Release.Name }} diff --git a/metrics-server/templates/serviceaccount.yaml b/metrics-server/templates/serviceaccount.yaml new file mode 100644 index 0000000..c657484 --- /dev/null +++ b/metrics-server/templates/serviceaccount.yaml @@ -0,0 +1,11 @@ +{{- if .Values.serviceAccount.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ template "metrics-server.serviceAccountName" . }} + labels: + app: {{ template "metrics-server.name" . }} + chart: {{ template "metrics-server.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- end }} diff --git a/metrics-server/values.yaml b/metrics-server/values.yaml new file mode 100644 index 0000000..89ef231 --- /dev/null +++ b/metrics-server/values.yaml @@ -0,0 +1,27 @@ +# Default values for elasticsearch-operator. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +image: + repository: k8s.gcr.io/metrics-server-amd64 + tag: v0.3.1 + pullPolicy: IfNotPresent + +resources: {} + +rbac: + create: true + +serviceAccount: + # Specifies whether a ServiceAccount should be created + create: true + # The name of the ServiceAccount to use. + # If not set and create is true, a name is generated using the fullname template + name: + +apiService: + # Specifies if the v1beta1.metrics.k8s.io API service should be created. + # + # You typically want this enabled! If you disable API service creation you have to + # manage it outside of this chart for e.g horizontal pod autoscaling to + # work with this release. + create: true