diff --git a/argocd/applications/prometheus-operator.yaml b/argocd/applications/monitoring.yaml similarity index 70% rename from argocd/applications/prometheus-operator.yaml rename to argocd/applications/monitoring.yaml index 0680754..9fc09b7 100644 --- a/argocd/applications/prometheus-operator.yaml +++ b/argocd/applications/monitoring.yaml @@ -1,13 +1,13 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: prometheus-operator + name: monitoring spec: project: default source: repoURL: git@github.com:hashbang/gitops.git - path: prometheus-operator/ + path: monitoring/ targetRevision: HEAD destination: server: https://kubernetes.default.svc - namespace: prometheus-operator + namespace: monitoring diff --git a/prometheus-operator/kustomization.yaml b/monitoring/kustomization.yaml similarity index 50% rename from prometheus-operator/kustomization.yaml rename to monitoring/kustomization.yaml index 6b8bec0..e3b00dc 100644 --- a/prometheus-operator/kustomization.yaml +++ b/monitoring/kustomization.yaml @@ -1,12 +1,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -namespace: prometheus-operator resources: - - namespace.yaml - # v0.38.1 - - github.com/coreos/prometheus-operator?ref=00cbd4911f931380cf9e19d771d7ebae1ec0a807 - - prometheus-operator-metrics.yaml - - prometheus-instance.yaml + # release-0.4; held back due to 0.5 not supporting Kubernetes 1.18 + - github.com/coreos/kube-prometheus?ref=ee8077db04965d6b4d9e6a328d5283dd6ba71d33 images: - name: quay.io/coreos/prometheus-operator:v0.38.1 digest: sha256:62b8cf466e9b238a9fcf0bcba74562c8833e7451042321e323a46de3f1dbe1bc diff --git a/prometheus-operator/namespace.yaml b/prometheus-operator/namespace.yaml deleted file mode 100644 index a586749..0000000 --- a/prometheus-operator/namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: prometheus-operator diff --git a/prometheus-operator/prometheus-instance.yaml b/prometheus-operator/prometheus-instance.yaml deleted file mode 100644 index 8f36143..0000000 --- a/prometheus-operator/prometheus-instance.yaml +++ /dev/null @@ -1,100 +0,0 @@ -# https://github.com/coreos/prometheus-operator/blob/master/Documentation/user-guides/getting-started.md#enable-rbac-rules-for-prometheus-pods -apiVersion: v1 -kind: ServiceAccount -metadata: - name: prometheus ---- -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: ClusterRole -metadata: - name: prometheus -rules: -- apiGroups: [""] - resources: - - nodes - - nodes/metrics - - services - - endpoints - - pods - verbs: ["get", "list", "watch"] -- apiGroups: [""] - resources: - - configmaps - verbs: ["get"] -- nonResourceURLs: ["/metrics"] - verbs: ["get"] ---- -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: ClusterRoleBinding -metadata: - name: prometheus -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: prometheus -subjects: -- kind: ServiceAccount - name: prometheus - namespace: default ---- -# https://github.com/coreos/prometheus-operator/blob/master/Documentation/user-guides/getting-started.md#include-servicemonitors -apiVersion: monitoring.coreos.com/v1 -kind: Prometheus -metadata: - name: prometheus -spec: - serviceAccountName: prometheus - serviceMonitorNamespaceSelector: {} # An empty label selector matches all objects. - serviceMonitorSelector: - matchLabels: - prometheusInstance: default - podMonitorNamespaceSelector: {} # An empty label selector matches all objects. - podMonitorSelector: - matchLabels: - prometheusInstance: default - resources: - requests: - memory: 400Mi - enableAdminAPI: false - # Hash lock prometheus container - sha: e4ca62c0d62f3e886e684806dfe9d4e0cda60d54986898173c1083856cfda0f4 - # Hash lock helper containers - containers: - - name: prometheus-config-reloader - image: quay.io/coreos/prometheus-config-reloader@sha256:d1cce64093d4a850d28726ec3e48403124808f76567b5bd7b26e4416300996a7 - - name: rules-configmap-reloader - image: docker.io/jimmidyson/configmap-reload@sha256:d107c7a235c266273b1c3502a391fec374430e5625539403d0de797fa9c556a2 - # - name: thanos-sidecar - # image: ---- -apiVersion: v1 -kind: Service -metadata: - name: prometheus - labels: - app: prometheus - prometheus: prometheus -spec: - ports: - - name: web - port: 9090 - protocol: TCP - targetPort: web - selector: - prometheus: prometheus ---- -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - name: prometheus-metrics - annotations: - argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true - labels: - prometheusInstance: default -spec: - selector: - matchLabels: - app: prometheus - prometheus: prometheus - endpoints: - - port: web diff --git a/prometheus-operator/prometheus-operator-metrics.yaml b/prometheus-operator/prometheus-operator-metrics.yaml deleted file mode 100644 index 00f78b6..0000000 --- a/prometheus-operator/prometheus-operator-metrics.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - name: prometheus-operator-metrics - annotations: - argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true - labels: - prometheusInstance: default -spec: - selector: - matchLabels: - app.kubernetes.io/name: prometheus-operator - endpoints: - - port: http