-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Use chart repository for cloudwatch adapter"
This reverts commit a47fe21.
- Loading branch information
1 parent
a47fe21
commit 9709073
Showing
15 changed files
with
428 additions
and
36 deletions.
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
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
apiVersion: v2 | ||
name: cloudwatch-adapter | ||
description: Configuration for cloudwatch adapter to fetch AWS Cloudwatch metrics in kubernetes | ||
|
||
type: application | ||
|
||
version: 0.1.0 | ||
|
||
appVersion: 1.0.0 | ||
|
||
# Downloaded from https://artifacthub.io/packages/helm/deliveryhero/k8s-cloudwatch-adapter |
61 changes: 61 additions & 0 deletions
61
platform/modules/cloudwatch-adapter/chart/templates/_helpers.tpl
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,61 @@ | ||
|
||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "k8s-cloudwatch-adapter.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 "k8s-cloudwatch-adapter.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 "k8s-cloudwatch-adapter.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "k8s-cloudwatch-adapter.labels" -}} | ||
app.kubernetes.io/name: {{ include "k8s-cloudwatch-adapter.name" . }} | ||
helm.sh/chart: {{ include "k8s-cloudwatch-adapter.chart" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- if .Values.extraLabels }} | ||
{{ toYaml .Values.extraLabels }} | ||
{{- end }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "k8s-cloudwatch-adapter.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create -}} | ||
{{ default (include "k8s-cloudwatch-adapter.fullname" .) .Values.serviceAccount.name }} | ||
{{- else -}} | ||
{{ default "default" .Values.serviceAccount.name }} | ||
{{- end -}} | ||
{{- end -}} | ||
|
14 changes: 14 additions & 0 deletions
14
platform/modules/cloudwatch-adapter/chart/templates/apiservice.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,14 @@ | ||
apiVersion: apiregistration.k8s.io/v1 | ||
kind: APIService | ||
metadata: | ||
name: v1beta1.external.metrics.k8s.io | ||
spec: | ||
service: | ||
name: {{ include "k8s-cloudwatch-adapter.fullname" . }} | ||
namespace: "{{ .Release.Namespace }}" | ||
group: external.metrics.k8s.io | ||
version: v1beta1 | ||
insecureSkipTLSVerify: true | ||
groupPriorityMinimum: 100 | ||
versionPriority: 100 | ||
|
41 changes: 41 additions & 0 deletions
41
platform/modules/cloudwatch-adapter/chart/templates/clusterrole.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,41 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: {{ include "k8s-cloudwatch-adapter.fullname" . }}:crd-metrics-reader | ||
labels: | ||
app: {{ .Release.Name }} | ||
rules: | ||
- apiGroups: | ||
- metrics.aws | ||
resources: | ||
- "externalmetrics" | ||
verbs: | ||
- list | ||
- get | ||
- watch | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: {{ include "k8s-cloudwatch-adapter.fullname" . }}-resource-reader | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- namespaces | ||
- pods | ||
- services | ||
verbs: | ||
- get | ||
- list | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: {{ include "k8s-cloudwatch-adapter.fullname" . }}:external-metrics-reader | ||
rules: | ||
- apiGroups: | ||
- external.metrics.k8s.io | ||
resources: ["*"] | ||
verbs: ["*"] | ||
|
55 changes: 55 additions & 0 deletions
55
platform/modules/cloudwatch-adapter/chart/templates/clusterrolebinding.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,55 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: {{ include "k8s-cloudwatch-adapter.fullname" . }}:crd-metrics-reader | ||
labels: | ||
app: {{ .Release.Name }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: {{ include "k8s-cloudwatch-adapter.fullname" . }}:crd-metrics-reader | ||
subjects: | ||
- name: {{ template "k8s-cloudwatch-adapter.serviceAccountName" . }} | ||
namespace: "{{ .Release.Namespace }}" | ||
kind: ServiceAccount | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: {{ include "k8s-cloudwatch-adapter.fullname" . }}-resource-reader | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: {{ include "k8s-cloudwatch-adapter.fullname" . }}-resource-reader | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ template "k8s-cloudwatch-adapter.serviceAccountName" . }} | ||
namespace: "{{ .Release.Namespace }}" | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: {{ include "k8s-cloudwatch-adapter.fullname" . }}:external-metrics-reader | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: {{ include "k8s-cloudwatch-adapter.fullname" . }}:external-metrics-reader | ||
subjects: | ||
- kind: ServiceAccount | ||
name: horizontal-pod-autoscaler | ||
namespace: kube-system | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: {{ include "k8s-cloudwatch-adapter.fullname" . }}:system:auth-delegator | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: system:auth-delegator | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ template "k8s-cloudwatch-adapter.serviceAccountName" . }} | ||
namespace: "{{ .Release.Namespace }}" | ||
|
||
|
84 changes: 84 additions & 0 deletions
84
platform/modules/cloudwatch-adapter/chart/templates/crd.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,84 @@ | ||
{{- if .Capabilities.APIVersions.Has "apiextensions.k8s.io/v1" }} | ||
apiVersion: apiextensions.k8s.io/v1 | ||
{{- else }} | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
{{- end }} | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: externalmetrics.metrics.aws | ||
spec: | ||
group: metrics.aws | ||
{{- if .Capabilities.APIVersions.Has "apiextensions.k8s.io/v1" }} | ||
versions: | ||
- name: v1alpha1 | ||
served: true | ||
storage: true | ||
schema: | ||
openAPIV3Schema: | ||
type: object | ||
properties: | ||
spec: | ||
type: object | ||
required: | ||
- name | ||
- queries | ||
properties: | ||
name: | ||
type: string | ||
roleArn: | ||
type: string | ||
region: | ||
type: string | ||
queries: | ||
type: array | ||
items: | ||
type: object | ||
properties: | ||
expression: | ||
type: string | ||
id: | ||
type: string | ||
label: | ||
type: string | ||
metricStat: | ||
type: object | ||
properties: | ||
metric: | ||
type: object | ||
required: | ||
- metricName | ||
properties: | ||
dimensions: | ||
type: array | ||
items: | ||
type: object | ||
required: | ||
- name | ||
- value | ||
properties: | ||
name: | ||
type: string | ||
value: | ||
type: string | ||
metricName: | ||
type: string | ||
namespace: | ||
type: string | ||
period: | ||
type: integer | ||
stat: | ||
type: string | ||
unit: | ||
type: string | ||
returnData: | ||
type: boolean | ||
{{- else }} | ||
version: v1alpha1 | ||
{{- end }} | ||
names: | ||
kind: ExternalMetric | ||
plural: externalmetrics | ||
singular: externalmetric | ||
scope: Namespaced | ||
|
||
|
63 changes: 63 additions & 0 deletions
63
platform/modules/cloudwatch-adapter/chart/templates/deployment.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,63 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "k8s-cloudwatch-adapter.fullname" . }} | ||
labels: | ||
{{ include "k8s-cloudwatch-adapter.labels" . | indent 4 }} | ||
spec: | ||
replicas: {{ .Values.replicaCount }} | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: {{ include "k8s-cloudwatch-adapter.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: {{ include "k8s-cloudwatch-adapter.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
serviceAccountName: {{ template "k8s-cloudwatch-adapter.serviceAccountName" . }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 12 }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
args: | ||
- /adapter | ||
{{- range $key, $val := .Values.adapter.args }} | ||
- --{{ $key }}={{ $val }} | ||
{{- end }} | ||
ports: | ||
- containerPort: 6443 | ||
name: https | ||
- containerPort: 8080 | ||
name: http | ||
volumeMounts: | ||
- mountPath: /tmp | ||
name: temp-vol | ||
resources: | ||
{{- toYaml .Values.resources | nindent 10 }} | ||
volumes: | ||
- name: temp-vol | ||
emptyDir: {} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
|
||
|
14 changes: 14 additions & 0 deletions
14
platform/modules/cloudwatch-adapter/chart/templates/rolebinding.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,14 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: {{ include "k8s-cloudwatch-adapter.fullname" . }}-auth-reader | ||
namespace: kube-system | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: extension-apiserver-authentication-reader | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "k8s-cloudwatch-adapter.fullname" . }} | ||
namespace: "{{ .Release.Namespace }}" | ||
|
19 changes: 19 additions & 0 deletions
19
platform/modules/cloudwatch-adapter/chart/templates/service.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,19 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "k8s-cloudwatch-adapter.fullname" . }} | ||
labels: | ||
{{ include "k8s-cloudwatch-adapter.labels" . | indent 4 }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
ports: | ||
- name: https | ||
port: 443 | ||
targetPort: 6443 | ||
- name: http | ||
port: 80 | ||
targetPort: 8080 | ||
selector: | ||
app.kubernetes.io/name: {{ include "k8s-cloudwatch-adapter.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
|
12 changes: 12 additions & 0 deletions
12
platform/modules/cloudwatch-adapter/chart/templates/serviceaccount.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,12 @@ | ||
{{- if .Values.serviceAccount.create -}} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ template "k8s-cloudwatch-adapter.serviceAccountName" . }} | ||
{{- with .Values.serviceAccount.annotations }} | ||
annotations: {{ toYaml . | nindent 4 }} | ||
{{- end }} | ||
labels: | ||
{{ include "k8s-cloudwatch-adapter.labels" . | indent 4 }} | ||
{{- end -}} | ||
|
Oops, something went wrong.