Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sample applications and grafana-operator argocd app for multi-account CDK Observability accelerator #28

Merged
merged 33 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions artifacts/argocd-apps/grafana-operator-app/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
name: grafana-operator-application
description: App of apps chart for the Grafana Operator.
version: 1.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: grafana-operator-app
namespace: {{ .Values.argoNamespace | default "argocd" }}
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: {{ .Values.argoProject | default "default" }}
destination:
namespace: grafana-operator
server: {{ .Values.spec.destination.server }}
source:
repoURL: {{ .Values.spec.source.repoURL }}
targetRevision: {{ .Values.spec.source.targetRevision }}
path: artifacts/argocd-apps/grafana-operator-chart
helm:
values: |
{{- toYaml .Values | nindent 8 }}
syncPolicy:
automated:
prune: true
syncOptions:
- CreateNamespace=true
25 changes: 25 additions & 0 deletions artifacts/argocd-apps/grafana-operator-app/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
argoNamespace: ''
argoProject: ''

spec:
destination:
server: https://kubernetes.default.svc
source:
repoURL: https://github.com/iamprakkie/aws-observability-accelerator.git
targetRevision: artifacts

AMP_ASSUME_ROLE_ARN: 'UPDATE_ME_WITH_AMP_ASSUME_ROLE_ARN'
AMP_AWS_REGION: 'UPDATE_ME_WITH_AMP_AWS_REGION'
AMP_ENDPOINT_URL: 'UPDATE_ME_WITH_AMP_ENDPOINT_URL'

CW_ASSUME_ROLE_ARN: 'UPDATE_ME_WITH_CW_ASSUME_ROLE_ARN'
CW_AWS_REGION: 'UPDATE_ME_WITH_CW_AWS_REGION'

AMG_ENDPOINT_URL: 'UPDATE_ME_WITH_AMG_ENDPOINT_URL_STARTING_WITH_HTTPS'

GRAFANA_CLUSTER_DASH_URL: "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/main/artifacts/grafana-dashboards/eks/infrastructure/cluster.json"
GRAFANA_KUBELET_DASH_URL: "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/main/artifacts/grafana-dashboards/eks/infrastructure/kubelet.json"
GRAFANA_NSWRKLDS_DASH_URL: "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/main/artifacts/grafana-dashboards/eks/infrastructure/namespace-workloads.json"
GRAFANA_NODEEXP_DASH_URL: "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/main/artifacts/grafana-dashboards/eks/infrastructure/nodeexporter-nodes.json"
GRAFANA_NODES_DASH_URL: "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/main/artifacts/grafana-dashboards/eks/infrastructure/nodes.json"
GRAFANA_WORKLOADS_DASH_URL: "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/main/artifacts/grafana-dashboards/eks/infrastructure/workloads.json"
23 changes: 23 additions & 0 deletions artifacts/argocd-apps/grafana-operator-chart/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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/
21 changes: 21 additions & 0 deletions artifacts/argocd-apps/grafana-operator-chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v2
name: grafana-operator-chart
description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.0.0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDatasource
metadata:
name: grafanadatasource-amp
namespace: grafana-operator
spec:
elamaran11 marked this conversation as resolved.
Show resolved Hide resolved
instanceSelector:
matchLabels:
dashboards: "external-grafana"
datasource:
name: grafana-operator-amp-datasource
type: prometheus
access: proxy
url: {{ .Values.AMP_ENDPOINT_URL }}
isDefault: true
jsonData:
'tlsSkipVerify': false
'timeInterval': "5s"
'sigV4Auth': true
'sigV4AuthType': "ec2_iam_role"
'sigV4AssumeRoleArn': {{ .Values.AMP_ASSUME_ROLE_ARN }}
'sigV4Region': {{ .Values.AMP_AWS_REGION }}
'defaultRegion': {{ .Values.AMP_AWS_REGION }}
editable: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDatasource
metadata:
name: grafanadatasource-cw
namespace: grafana-operator
spec:
instanceSelector:
matchLabels:
dashboards: "external-grafana"
datasource:
name: grafana-operator-cloudwatch-datasource
type: cloudwatch
access: server
isDefault: false
jsonData:
'tlsSkipVerify': false
'authType': "ec2_iam_role"
'assumeRoleArn': {{ .Values.CW_ASSUME_ROLE_ARN }}
'defaultRegion': {{ .Values.CW_AWS_REGION }}
'customMetricsNamespaces': "ContainerInsights/Prometheus"
editable: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
name: node-exporter-grafanadashboard
namespace: grafana-operator
spec:
folder: "Observability Accelerator Dashboards"
instanceSelector:
matchLabels:
dashboards: "external-grafana"
url: {{ .Values.GRAFANA_NODEEXP_DASH_URL }}
---
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
name: cluster-grafanadashboard
namespace: grafana-operator
spec:
folder: "Observability Accelerator Dashboards"
instanceSelector:
matchLabels:
dashboards: "external-grafana"
url: {{ .Values.GRAFANA_CLUSTER_DASH_URL }}
---
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
name: kubelet-grafanadashboard
namespace: grafana-operator
spec:
folder: "Observability Accelerator Dashboards"
instanceSelector:
matchLabels:
dashboards: "external-grafana"
url: {{ .Values.GRAFANA_KUBELET_DASH_URL }}
---
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
name: namespace-workloads-grafanadashboard
namespace: grafana-operator
spec:
folder: "Observability Accelerator Dashboards"
instanceSelector:
matchLabels:
dashboards: "external-grafana"
url: {{ .Values.GRAFANA_NSWRKLDS_DASH_URL }}
---
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
name: nodes-grafanadashboard
namespace: grafana-operator
spec:
folder: "Observability Accelerator Dashboards"
instanceSelector:
matchLabels:
dashboards: "external-grafana"
url: {{ .Values.GRAFANA_NODES_DASH_URL }}
---
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
name: workloads-grafanadashboard
namespace: grafana-operator
spec:
folder: "Observability Accelerator Dashboards"
instanceSelector:
matchLabels:
dashboards: "external-grafana"
url: {{ .Values.GRAFANA_WORKLOADS_DASH_URL }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: grafana.integreatly.org/v1beta1
kind: Grafana
metadata:
name: external-grafana
namespace: grafana-operator
labels:
dashboards: "external-grafana"
spec:
external:
url: {{ .Values.AMG_ENDPOINT_URL }}
apiKey:
name: grafana-admin-credentials
key: GF_SECURITY_ADMIN_APIKEY
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDatasource
metadata:
name: grafanadatasource-xray
namespace: grafana-operator
spec:
instanceSelector:
matchLabels:
dashboards: "external-grafana"
datasource:
name: grafana-operator-xray-datasource
type: grafana-x-ray-datasource
access: server
isDefault: false
jsonData:
'tlsSkipVerify': false
'authType': "ec2_iam_role"
'assumeRoleArn': {{ .Values.CW_ASSUME_ROLE_ARN }}
'defaultRegion': {{ .Values.CW_AWS_REGION }}
editable: true
1 change: 1 addition & 0 deletions artifacts/argocd-apps/grafana-operator-chart/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kubernetesClusterDomain: cluster.local
5 changes: 5 additions & 0 deletions artifacts/argocd-apps/sample-apps/envs/prod/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
name: prod-applications
description: App of apps chart for the prod EKS environment.
version: 1.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
elamaran11 marked this conversation as resolved.
Show resolved Hide resolved
metadata:
name: team-carmen
namespace: {{ .Values.argoNamespace | default "argocd" }}
labels:
{{- toYaml .Values.labels | nindent 4 }}
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: {{ .Values.argoProject | default "default" }}
destination:
namespace: team-carmen
server: {{ .Values.spec.destination.server }}
source:
repoURL: https://github.com/CarmenAPuccio/GeoLocationAPI
path: templates
targetRevision: HEAD
syncPolicy:
automated:
prune: true
syncOptions:
- CreateNamespace=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: team-geordie
namespace: {{ .Values.argoNamespace | default "argocd" }}
labels:
{{- toYaml .Values.labels | nindent 4 }}
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: {{ .Values.argoProject | default "default" }}
destination:
namespace: {{ .Values.argoNamespace | default "argocd" }}
server: {{ .Values.destinationServer | default .Values.spec.destination.server }}
source:
repoURL: {{ .Values.spec.source.repoURL }}
targetRevision: {{ .Values.spec.source.targetRevision }}
path: artifacts/argocd-apps/teams/team-geordie/prod
helm:
values: |
{{- toYaml .Values | nindent 8 }}
syncPolicy:
automated:
prune: true
syncOptions:
- CreateNamespace=true
21 changes: 21 additions & 0 deletions artifacts/argocd-apps/sample-apps/envs/prod/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
destinationServer: ''
argoNamespace: ''
argoProject: ''

labels:
env: prod
spec:
destination:
server: https://kubernetes.default.svc
source:
repoURL: https://github.com/iamprakkie/aws-observability-accelerator.git
targetRevision: artifacts

# Thoses default values can be surcharged by Infrastructure as Code
env: prod
clusterName: coa-eks-blueprint-cluster # the name of EKS cluster
blueprint: 'terraform' # cdk | terraform
karpenterInstanceProfile:
ingress:
type: 'alb' # nginx | alb
host: # empty or your domain like dev.example.com
5 changes: 5 additions & 0 deletions artifacts/argocd-apps/teams/team-geordie/prod/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
name: monapps
description: Charts of Monitoring Apps for the prod EKS environment.
version: 0.1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
name: ho11y
description: Charts of Monitoring Apps for the prod EKS environment.
version: 0.1.0
Loading