diff --git a/README.md b/README.md index 82ccaf29fd0b39251252fb4581cd4602f3b798c3..f91b748fc192956fbd10b28990b4713b3dbb4ce9 100644 --- a/README.md +++ b/README.md @@ -676,6 +676,10 @@ See [exposing Prometheus/Alertmanager/Grafana](docs/exposing-prometheus-alertman To use an easy to reproduce example, see [minikube.jsonnet](examples/minikube.jsonnet), which uses the minikube setup as demonstrated in [Prerequisites](#prerequisites). Because we would like easy access to our Prometheus, Alertmanager and Grafana UIs, `minikube.jsonnet` exposes the services as NodePort type services. +## Continuous Delivery + +Working examples of use with continuous delivery tools are found in examples/continuous-delivery. + ## Troubleshooting ### Error retrieving kubelet metrics diff --git a/examples/continuous-delivery/argocd/README.md b/examples/continuous-delivery/argocd/README.md new file mode 100644 index 0000000000000000000000000000000000000000..00fed8bfb309062cbecb9eb952a5ce1590bac9cb --- /dev/null +++ b/examples/continuous-delivery/argocd/README.md @@ -0,0 +1,9 @@ +## ArgoCD Example + +This is the simplest, working example of an argocd app, the JSON object built is now an array of objects as that is the prefered format for ArgoCD. + +Requirements: + +**ArgoCD 1.7+** + +Follow the vendor generation steps at the root of this repository and generate a `vendored` folder (referenced in `application.yaml`). diff --git a/examples/continuous-delivery/argocd/application.yaml b/examples/continuous-delivery/argocd/application.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1bc1264e749c606f73583c995f0e10c663d6c744 --- /dev/null +++ b/examples/continuous-delivery/argocd/application.yaml @@ -0,0 +1,25 @@ +--- +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: kube-prometheus + namespace: argocd + annotations: + recipients.argocd-notifications.argoproj.io: "slack:jenkins" +spec: + destination: + namespace: monitoring + server: https://kubernetes.default.svc + project: monitoring + source: + directory: + jsonnet: + libs: + - vendored + recurse: true + path: examples/continuous-delivery/argocd/kube-prometheus + repoURL: git@github.com:prometheus-operator/kube-prometheus.git + targetRevision: HEAD + syncPolicy: + automated: {} +--- diff --git a/examples/continuous-delivery/argocd/appproject.yaml b/examples/continuous-delivery/argocd/appproject.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a571b7820c61d28926481a63250e3921ec83a6ba --- /dev/null +++ b/examples/continuous-delivery/argocd/appproject.yaml @@ -0,0 +1,22 @@ +apiVersion: argoproj.io/v1alpha1 +kind: AppProject +metadata: + annotations: + recipients.argocd-notifications.argoproj.io: slack:alerts + generation: 1 + name: monitoring + namespace: argocd +spec: + clusterResourceWhitelist: + - group: "*" + kind: "*" + description: "Monitoring Stack deployment" + destinations: + - namespace: kube-system + server: https://kubernetes.default.svc + - namespace: default + server: https://kubernetes.default.svc + - namespace: monitoring + server: https://kubernetes.default.svc + sourceRepos: + - git@github.com:prometheus-operator/kube-prometheus.git diff --git a/examples/continuous-delivery/argocd/kube-prometheus/argocd-basic.jsonnet b/examples/continuous-delivery/argocd/kube-prometheus/argocd-basic.jsonnet new file mode 100644 index 0000000000000000000000000000000000000000..bcfaedf7e9941c83642627514b5d494913b92181 --- /dev/null +++ b/examples/continuous-delivery/argocd/kube-prometheus/argocd-basic.jsonnet @@ -0,0 +1,13 @@ +local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') + { + + _config+:: { + namespace: 'monitoring', + }, +}; + +[kp.kubePrometheus[name] for name in std.objectFields(kp.kubePrometheus)] + +[kp.prometheusOperator[name] for name in std.objectFields(kp.prometheusOperator)] + +[kp.nodeExporter[name] for name in std.objectFields(kp.nodeExporter)] + +[kp.kubeStateMetrics[name] for name in std.objectFields(kp.kubeStateMetrics)] + +[kp.prometheus[name] for name in std.objectFields(kp.prometheus)] + +[kp.prometheusAdapter[name] for name in std.objectFields(kp.prometheusAdapter)]