-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
821 additions
and
0 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 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,25 @@ | ||
# 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 | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ | ||
# Release related files | ||
release/ |
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,13 @@ | ||
apiVersion: v2 | ||
name: amazon-cloudwatch-observability | ||
version: 1.2.0 | ||
appVersion: 1.0.0 | ||
description: A Helm chart for Amazon CloudWatch Observability | ||
type: application | ||
home: https://aws.amazon.com/cloudwatch/ | ||
sources: | ||
- https://github.com/aws/amazon-cloudwatch-agent-operator | ||
maintainers: | ||
- name: straussb | ||
- name: lisaguo | ||
- name: kausyas |
116 changes: 116 additions & 0 deletions
116
integration-tests/terraform/testbuild/helm/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,116 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "amazon-cloudwatch-observability.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Name for cloudwatch-agent | ||
*/}} | ||
{{- define "cloudwatch-agent.name" -}} | ||
{{- default "cloudwatch-agent" .Values.agent.name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Get the current recommended cloudwatch agent image for a region | ||
*/}} | ||
{{- define "cloudwatch-agent.image" -}} | ||
{{- $imageDomain := "" -}} | ||
{{- $imageDomain = index .Values.agent.image.repositoryDomainMap .Values.region -}} | ||
{{- if not $imageDomain -}} | ||
{{- $imageDomain = .Values.agent.image.repositoryDomainMap.public -}} | ||
{{- end -}} | ||
{{- printf "%s/%s:%s" $imageDomain .Values.agent.image.repository .Values.agent.image.tag -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Get the current recommended cloudwatch agent operator image for a region | ||
*/}} | ||
{{- define "cloudwatch-agent-operator.image" -}} | ||
{{- $imageDomain := "" -}} | ||
{{- $imageDomain = index .Values.manager.image.repositoryDomainMap .Values.region -}} | ||
{{- if not $imageDomain -}} | ||
{{- $imageDomain = .Values.manager.image.repositoryDomainMap.public -}} | ||
{{- end -}} | ||
{{- printf "%s/%s:%s" $imageDomain .Values.manager.image.repository .Values.manager.image.tag -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Get the current recommended fluent-bit image for a region | ||
*/}} | ||
{{- define "fluent-bit.image" -}} | ||
{{- $imageDomain := "" -}} | ||
{{- $imageDomain = index .Values.containerLogs.fluentBit.image.repositoryDomainMap .Values.region -}} | ||
{{- if not $imageDomain -}} | ||
{{- $imageDomain = .Values.containerLogs.fluentBit.image.repositoryDomainMap.public -}} | ||
{{- end -}} | ||
{{- printf "%s/%s:%s" $imageDomain .Values.containerLogs.fluentBit.image.repository .Values.containerLogs.fluentBit.image.tag -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "amazon-cloudwatch-observability.labels" -}} | ||
{{ include "amazon-cloudwatch-observability.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: EKS | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "amazon-cloudwatch-observability.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "amazon-cloudwatch-observability.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "amazon-cloudwatch-observability.managerServiceAccountName" -}} | ||
{{- if .Values.manager.serviceAccount.create }} | ||
{{- default (printf "%s-controller-manager" (include "amazon-cloudwatch-observability.name" .)) .Values.manager.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.manager.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "cloudwatch-agent.serviceAccountName" -}} | ||
{{- if .Values.agent.enabled }} | ||
{{- default (include "cloudwatch-agent.name" .) .Values.agent.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.agent.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- define "amazon-cloudwatch-observability.podAnnotations" -}} | ||
{{- if .Values.manager.podAnnotations }} | ||
{{- .Values.manager.podAnnotations | toYaml }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- define "amazon-cloudwatch-observability.podLabels" -}} | ||
{{- if .Values.manager.podLabels }} | ||
{{- .Values.manager.podLabels | toYaml }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Define the default certificate secret name | ||
*/}} | ||
{{- define "amazon-cloudwatch-observability.certificateSecretName" -}} | ||
{{- default (printf "%s-controller-manager-service-cert" (include "amazon-cloudwatch-observability.name" .)) .Values.admissionWebhooks.secretName }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Define the default service name | ||
*/}} | ||
{{- define "amazon-cloudwatch-observability.webhookServiceName" -}} | ||
{{- default (printf "%s-webhook-service" (include "amazon-cloudwatch-observability.name" .)) .Values.manager.service.name }} | ||
{{- end -}} |
222 changes: 222 additions & 0 deletions
222
...aform/testbuild/helm/templates/admission-webhooks/operator-webhook-with-cert-manager.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,222 @@ | ||
{{- if and (.Values.admissionWebhooks.create) (.Values.admissionWebhooks.certManager.enabled) }} | ||
apiVersion: admissionregistration.k8s.io/v1 | ||
kind: MutatingWebhookConfiguration | ||
metadata: | ||
annotations: | ||
cert-manager.io/inject-ca-from: {{ printf "%s/%s-serving-cert" .Release.Namespace (include "amazon-cloudwatch-observability.name" .) }} | ||
labels: | ||
{{- include "amazon-cloudwatch-observability.labels" . | nindent 4}} | ||
name: {{ template "amazon-cloudwatch-observability.name" . }}-mutating-webhook-configuration | ||
webhooks: | ||
- admissionReviewVersions: | ||
- v1 | ||
clientConfig: | ||
service: | ||
name: {{ template "amazon-cloudwatch-observability.webhookServiceName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
path: /mutate-cloudwatch-aws-amazon-com-v1alpha1-instrumentation | ||
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }} | ||
name: minstrumentation.kb.io | ||
{{- if .Values.admissionWebhooks.namespaceSelector }} | ||
namespaceSelector: | ||
{{- toYaml .Values.admissionWebhooks.namespaceSelector | nindent 6 }} | ||
{{- end }} | ||
{{- if .Values.admissionWebhooks.objectSelector }} | ||
objectSelector: | ||
{{- toYaml .Values.admissionWebhooks.objectSelector | nindent 6 }} | ||
{{- end }} | ||
rules: | ||
- apiGroups: | ||
- cloudwatch.aws.amazon.com | ||
apiVersions: | ||
- v1alpha1 | ||
operations: | ||
- CREATE | ||
- UPDATE | ||
resources: | ||
- instrumentations | ||
sideEffects: None | ||
timeoutSeconds: {{ .Values.admissionWebhooks.timeoutSeconds }} | ||
- admissionReviewVersions: | ||
- v1 | ||
clientConfig: | ||
service: | ||
name: {{ template "amazon-cloudwatch-observability.webhookServiceName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
path: /mutate-cloudwatch-aws-amazon-com-v1alpha1-amazoncloudwatchagent | ||
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }} | ||
name: mamazoncloudwatchagent.kb.io | ||
{{- if .Values.admissionWebhooks.namespaceSelector }} | ||
namespaceSelector: | ||
{{- toYaml .Values.admissionWebhooks.namespaceSelector | nindent 6 }} | ||
{{- end }} | ||
{{- if .Values.admissionWebhooks.objectSelector }} | ||
objectSelector: | ||
{{- toYaml .Values.admissionWebhooks.objectSelector | nindent 6 }} | ||
{{- end }} | ||
rules: | ||
- apiGroups: | ||
- cloudwatch.aws.amazon.com | ||
apiVersions: | ||
- v1alpha1 | ||
operations: | ||
- CREATE | ||
- UPDATE | ||
resources: | ||
- amazoncloudwatchagents | ||
sideEffects: None | ||
timeoutSeconds: {{ .Values.admissionWebhooks.timeoutSeconds }} | ||
- admissionReviewVersions: | ||
- v1 | ||
clientConfig: | ||
service: | ||
name: {{ template "amazon-cloudwatch-observability.webhookServiceName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
path: /mutate-v1-pod | ||
failurePolicy: {{ .Values.admissionWebhooks.pods.failurePolicy }} | ||
name: mpod.kb.io | ||
{{- if .Values.admissionWebhooks.namespaceSelector }} | ||
namespaceSelector: | ||
{{- toYaml .Values.admissionWebhooks.namespaceSelector | nindent 6 }} | ||
{{- end }} | ||
{{- if .Values.admissionWebhooks.objectSelector }} | ||
objectSelector: | ||
{{- toYaml .Values.admissionWebhooks.objectSelector | nindent 6 }} | ||
{{- end }} | ||
rules: | ||
- apiGroups: | ||
- "" | ||
apiVersions: | ||
- v1 | ||
operations: | ||
- CREATE | ||
- UPDATE | ||
resources: | ||
- pods | ||
sideEffects: None | ||
timeoutSeconds: {{ .Values.admissionWebhooks.timeoutSeconds }} | ||
--- | ||
apiVersion: admissionregistration.k8s.io/v1 | ||
kind: ValidatingWebhookConfiguration | ||
metadata: | ||
annotations: | ||
cert-manager.io/inject-ca-from: {{ printf "%s/%s-serving-cert" .Release.Namespace (include "amazon-cloudwatch-observability.name" .) }} | ||
labels: | ||
{{- include "amazon-cloudwatch-observability.labels" . | nindent 4}} | ||
name: {{ template "amazon-cloudwatch-observability.name" . }}-validating-webhook-configuration | ||
webhooks: | ||
- admissionReviewVersions: | ||
- v1 | ||
clientConfig: | ||
service: | ||
name: {{ template "amazon-cloudwatch-observability.webhookServiceName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
path: /validate-cloudwatch-aws-amazon-com-v1alpha1-instrumentation | ||
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }} | ||
name: vinstrumentationcreateupdate.kb.io | ||
{{- if .Values.admissionWebhooks.namespaceSelector }} | ||
namespaceSelector: | ||
{{- toYaml .Values.admissionWebhooks.namespaceSelector | nindent 6 }} | ||
{{- end }} | ||
{{- if .Values.admissionWebhooks.objectSelector }} | ||
objectSelector: | ||
{{- toYaml .Values.admissionWebhooks.objectSelector | nindent 6 }} | ||
{{- end }} | ||
rules: | ||
- apiGroups: | ||
- cloudwatch.aws.amazon.com | ||
apiVersions: | ||
- v1alpha1 | ||
operations: | ||
- CREATE | ||
- UPDATE | ||
resources: | ||
- instrumentations | ||
sideEffects: None | ||
timeoutSeconds: {{ .Values.admissionWebhooks.timeoutSeconds }} | ||
- admissionReviewVersions: | ||
- v1 | ||
clientConfig: | ||
service: | ||
name: {{ template "amazon-cloudwatch-observability.webhookServiceName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
path: /validate-cloudwatch-aws-amazon-com-v1alpha1-instrumentation | ||
failurePolicy: Ignore | ||
name: vinstrumentationdelete.kb.io | ||
{{- if .Values.admissionWebhooks.namespaceSelector }} | ||
namespaceSelector: | ||
{{- toYaml .Values.admissionWebhooks.namespaceSelector | nindent 6 }} | ||
{{- end }} | ||
{{- if .Values.admissionWebhooks.objectSelector }} | ||
objectSelector: | ||
{{- toYaml .Values.admissionWebhooks.objectSelector | nindent 6 }} | ||
{{- end }} | ||
rules: | ||
- apiGroups: | ||
- cloudwatch.aws.amazon.com | ||
apiVersions: | ||
- v1alpha1 | ||
operations: | ||
- DELETE | ||
resources: | ||
- instrumentations | ||
sideEffects: None | ||
timeoutSeconds: {{ .Values.admissionWebhooks.timeoutSeconds }} | ||
- admissionReviewVersions: | ||
- v1 | ||
clientConfig: | ||
service: | ||
name: {{ template "amazon-cloudwatch-observability.webhookServiceName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
path: /validate-cloudwatch-aws-amazon-com-v1alpha1-amazoncloudwatchagent | ||
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }} | ||
name: vamazoncloudwatchagentcreateupdate.kb.io | ||
{{- if .Values.admissionWebhooks.namespaceSelector }} | ||
namespaceSelector: | ||
{{- toYaml .Values.admissionWebhooks.namespaceSelector | nindent 6 }} | ||
{{- end }} | ||
{{- if .Values.admissionWebhooks.objectSelector }} | ||
objectSelector: | ||
{{- toYaml .Values.admissionWebhooks.objectSelector | nindent 6 }} | ||
{{- end }} | ||
rules: | ||
- apiGroups: | ||
- cloudwatch.aws.amazon.com | ||
apiVersions: | ||
- v1alpha1 | ||
operations: | ||
- CREATE | ||
- UPDATE | ||
resources: | ||
- amazoncloudwatchagents | ||
sideEffects: None | ||
timeoutSeconds: {{ .Values.admissionWebhooks.timeoutSeconds }} | ||
- admissionReviewVersions: | ||
- v1 | ||
clientConfig: | ||
service: | ||
name: {{ template "amazon-cloudwatch-observability.webhookServiceName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
path: /validate-cloudwatch-aws-amazon-com-v1alpha1-amazoncloudwatchagent | ||
failurePolicy: Ignore | ||
name: vamazoncloudwatchagentdelete.kb.io | ||
{{- if .Values.admissionWebhooks.namespaceSelector }} | ||
namespaceSelector: | ||
{{- toYaml .Values.admissionWebhooks.namespaceSelector | nindent 6 }} | ||
{{- end }} | ||
{{- if .Values.admissionWebhooks.objectSelector }} | ||
objectSelector: | ||
{{- toYaml .Values.admissionWebhooks.objectSelector | nindent 6 }} | ||
{{- end }} | ||
rules: | ||
- apiGroups: | ||
- cloudwatch.aws.amazon.com | ||
apiVersions: | ||
- v1alpha1 | ||
operations: | ||
- DELETE | ||
resources: | ||
- amazoncloudwatchagents | ||
sideEffects: None | ||
timeoutSeconds: {{ .Values.admissionWebhooks.timeoutSeconds }} | ||
{{- end }} |
Oops, something went wrong.