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

feat: deploy silence-operator #8576

Merged
merged 3 commits into from
Dec 30, 2024
Merged

feat: deploy silence-operator #8576

merged 3 commits into from
Dec 30, 2024

Conversation

onedr0p
Copy link
Owner

@onedr0p onedr0p commented Dec 30, 2024

  • Deploy silence operator and silence operator crds from wiremind helm charts
  • Rename prometheus-operator-crds to kube-prometheus-stack-crds and nest under kube-prometheus-stack folder

@bot-ross bot-ross bot added area/kubernetes Changes made in the kubernetes directory cluster/main labels Dec 30, 2024
@bot-ross
Copy link
Contributor

bot-ross bot commented Dec 30, 2024

--- kubernetes/shared Kustomization: flux-system/cluster-shared HelmRepository: flux-system/stevehipwell

+++ kubernetes/shared Kustomization: flux-system/cluster-shared HelmRepository: flux-system/stevehipwell

@@ -1,14 +0,0 @@

----
-apiVersion: source.toolkit.fluxcd.io/v1
-kind: HelmRepository
-metadata:
-  labels:
-    kustomize.toolkit.fluxcd.io/name: cluster-shared
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: stevehipwell
-  namespace: flux-system
-spec:
-  interval: 5m
-  type: oci
-  url: oci://ghcr.io/stevehipwell/helm-charts
-
--- kubernetes/shared Kustomization: flux-system/cluster-shared HelmRepository: flux-system/wiremind

+++ kubernetes/shared Kustomization: flux-system/cluster-shared HelmRepository: flux-system/wiremind

@@ -0,0 +1,13 @@

+---
+apiVersion: source.toolkit.fluxcd.io/v1
+kind: HelmRepository
+metadata:
+  labels:
+    kustomize.toolkit.fluxcd.io/name: cluster-shared
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: wiremind
+  namespace: flux-system
+spec:
+  interval: 2h
+  url: https://wiremind.github.io/wiremind-helm-charts/
+
--- kubernetes/main/apps/observability/prometheus-operator-crds/app Kustomization: flux-system/prometheus-operator-crds HelmRelease: observability/prometheus-operator-crds

+++ kubernetes/main/apps/observability/prometheus-operator-crds/app Kustomization: flux-system/prometheus-operator-crds HelmRelease: observability/prometheus-operator-crds

@@ -1,28 +0,0 @@

----
-apiVersion: helm.toolkit.fluxcd.io/v2
-kind: HelmRelease
-metadata:
-  labels:
-    app.kubernetes.io/name: prometheus-operator-crds
-    kustomize.toolkit.fluxcd.io/name: prometheus-operator-crds
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: prometheus-operator-crds
-  namespace: observability
-spec:
-  chart:
-    spec:
-      chart: prometheus-operator-crds
-      sourceRef:
-        kind: HelmRepository
-        name: prometheus-community
-        namespace: flux-system
-      version: 17.0.2
-  install:
-    remediation:
-      retries: 3
-  interval: 30m
-  upgrade:
-    cleanupOnFail: true
-    remediation:
-      retries: 3
-
--- kubernetes/main/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/prometheus-operator-crds

+++ kubernetes/main/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/prometheus-operator-crds

@@ -1,35 +0,0 @@

----
-apiVersion: kustomize.toolkit.fluxcd.io/v1
-kind: Kustomization
-metadata:
-  labels:
-    kustomize.toolkit.fluxcd.io/name: cluster-apps
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: prometheus-operator-crds
-  namespace: flux-system
-spec:
-  commonMetadata:
-    labels:
-      app.kubernetes.io/name: prometheus-operator-crds
-  decryption:
-    provider: sops
-    secretRef:
-      name: sops-age
-  interval: 30m
-  path: ./kubernetes/main/apps/observability/prometheus-operator-crds/app
-  postBuild:
-    substituteFrom:
-    - kind: ConfigMap
-      name: cluster-settings
-      optional: true
-    - kind: Secret
-      name: cluster-secrets
-      optional: true
-  prune: false
-  sourceRef:
-    kind: GitRepository
-    name: home-kubernetes
-  targetNamespace: observability
-  timeout: 5m
-  wait: false
-
--- kubernetes/main/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/kube-prometheus-stack-crds

+++ kubernetes/main/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/kube-prometheus-stack-crds

@@ -0,0 +1,35 @@

+---
+apiVersion: kustomize.toolkit.fluxcd.io/v1
+kind: Kustomization
+metadata:
+  labels:
+    kustomize.toolkit.fluxcd.io/name: cluster-apps
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: kube-prometheus-stack-crds
+  namespace: flux-system
+spec:
+  commonMetadata:
+    labels:
+      app.kubernetes.io/name: kube-prometheus-stack-crds
+  decryption:
+    provider: sops
+    secretRef:
+      name: sops-age
+  interval: 30m
+  path: ./kubernetes/main/apps/observability/kube-prometheus-stack/crds
+  postBuild:
+    substituteFrom:
+    - kind: ConfigMap
+      name: cluster-settings
+      optional: true
+    - kind: Secret
+      name: cluster-secrets
+      optional: true
+  prune: false
+  sourceRef:
+    kind: GitRepository
+    name: home-kubernetes
+  targetNamespace: observability
+  timeout: 5m
+  wait: false
+
--- kubernetes/main/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/silence-operator

+++ kubernetes/main/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/silence-operator

@@ -0,0 +1,35 @@

+---
+apiVersion: kustomize.toolkit.fluxcd.io/v1
+kind: Kustomization
+metadata:
+  labels:
+    kustomize.toolkit.fluxcd.io/name: cluster-apps
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: silence-operator
+  namespace: flux-system
+spec:
+  commonMetadata:
+    labels:
+      app.kubernetes.io/name: silence-operator
+  decryption:
+    provider: sops
+    secretRef:
+      name: sops-age
+  interval: 30m
+  path: ./kubernetes/main/apps/observability/silence-operator/app
+  postBuild:
+    substituteFrom:
+    - kind: ConfigMap
+      name: cluster-settings
+      optional: true
+    - kind: Secret
+      name: cluster-secrets
+      optional: true
+  prune: true
+  sourceRef:
+    kind: GitRepository
+    name: home-kubernetes
+  targetNamespace: observability
+  timeout: 15m
+  wait: false
+
--- kubernetes/main/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/silence-operator-crds

+++ kubernetes/main/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/silence-operator-crds

@@ -0,0 +1,35 @@

+---
+apiVersion: kustomize.toolkit.fluxcd.io/v1
+kind: Kustomization
+metadata:
+  labels:
+    kustomize.toolkit.fluxcd.io/name: cluster-apps
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: silence-operator-crds
+  namespace: flux-system
+spec:
+  commonMetadata:
+    labels:
+      app.kubernetes.io/name: silence-operator-crds
+  decryption:
+    provider: sops
+    secretRef:
+      name: sops-age
+  interval: 30m
+  path: ./kubernetes/main/apps/observability/silence-operator/crds
+  postBuild:
+    substituteFrom:
+    - kind: ConfigMap
+      name: cluster-settings
+      optional: true
+    - kind: Secret
+      name: cluster-secrets
+      optional: true
+  prune: false
+  sourceRef:
+    kind: GitRepository
+    name: home-kubernetes
+  targetNamespace: observability
+  timeout: 5m
+  wait: false
+
--- kubernetes/main/apps/observability/kube-prometheus-stack/app Kustomization: flux-system/kube-prometheus-stack HelmRelease: observability/kube-prometheus-stack

+++ kubernetes/main/apps/observability/kube-prometheus-stack/app Kustomization: flux-system/kube-prometheus-stack HelmRelease: observability/kube-prometheus-stack

@@ -15,13 +15,13 @@

       sourceRef:
         kind: HelmRepository
         name: prometheus-community
         namespace: flux-system
       version: 67.5.0
   dependsOn:
-  - name: prometheus-operator-crds
+  - name: kube-prometheus-stack-crds
     namespace: observability
   - name: rook-ceph-cluster
     namespace: rook-ceph
   install:
     crds: Skip
     remediation:
--- kubernetes/main/apps/observability/kube-prometheus-stack/crds Kustomization: flux-system/kube-prometheus-stack-crds HelmRelease: observability/kube-prometheus-stack-crds

+++ kubernetes/main/apps/observability/kube-prometheus-stack/crds Kustomization: flux-system/kube-prometheus-stack-crds HelmRelease: observability/kube-prometheus-stack-crds

@@ -0,0 +1,28 @@

+---
+apiVersion: helm.toolkit.fluxcd.io/v2
+kind: HelmRelease
+metadata:
+  labels:
+    app.kubernetes.io/name: kube-prometheus-stack-crds
+    kustomize.toolkit.fluxcd.io/name: kube-prometheus-stack-crds
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: kube-prometheus-stack-crds
+  namespace: observability
+spec:
+  chart:
+    spec:
+      chart: prometheus-operator-crds
+      sourceRef:
+        kind: HelmRepository
+        name: prometheus-community
+        namespace: flux-system
+      version: 17.0.2
+  install:
+    remediation:
+      retries: 3
+  interval: 30m
+  upgrade:
+    cleanupOnFail: true
+    remediation:
+      retries: 3
+
--- kubernetes/main/apps/observability/silence-operator/crds Kustomization: flux-system/silence-operator-crds HelmRelease: observability/silence-operator-crds

+++ kubernetes/main/apps/observability/silence-operator/crds Kustomization: flux-system/silence-operator-crds HelmRelease: observability/silence-operator-crds

@@ -0,0 +1,29 @@

+---
+apiVersion: helm.toolkit.fluxcd.io/v2
+kind: HelmRelease
+metadata:
+  labels:
+    app.kubernetes.io/name: silence-operator-crds
+    kustomize.toolkit.fluxcd.io/name: silence-operator-crds
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: silence-operator-crds
+  namespace: observability
+spec:
+  chart:
+    spec:
+      chart: silence-operator-crds
+      sourceRef:
+        kind: HelmRepository
+        name: wiremind
+        namespace: flux-system
+      version: 0.0.2
+  install:
+    remediation:
+      retries: 3
+  interval: 30m
+  upgrade:
+    cleanupOnFail: true
+    remediation:
+      retries: 3
+      strategy: rollback
+
--- kubernetes/main/apps/observability/silence-operator/app Kustomization: flux-system/silence-operator HelmRelease: observability/silence-operator

+++ kubernetes/main/apps/observability/silence-operator/app Kustomization: flux-system/silence-operator HelmRelease: observability/silence-operator

@@ -0,0 +1,76 @@

+---
+apiVersion: helm.toolkit.fluxcd.io/v2
+kind: HelmRelease
+metadata:
+  labels:
+    app.kubernetes.io/name: silence-operator
+    kustomize.toolkit.fluxcd.io/name: silence-operator
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: silence-operator
+  namespace: observability
+spec:
+  chart:
+    spec:
+      chart: silence-operator
+      sourceRef:
+        kind: HelmRepository
+        name: wiremind
+        namespace: flux-system
+      version: 0.0.7
+  dependsOn:
+  - name: silence-operator-crds
+    namespace: observability
+  install:
+    remediation:
+      retries: 3
+  interval: 30m
+  upgrade:
+    cleanupOnFail: true
+    remediation:
+      retries: 3
+      strategy: rollback
+  values:
+    extraDeply:
+    - apiVersion: monitoring.giantswarm.io/v1alpha1
+      kind: Silence
+      metadata:
+        name: ceph-node-nfsmount-diskspace-warning
+      spec:
+        matchers:
+        - isRegex: false
+          name: alertname
+          value: CephNodeDiskspaceWarning
+        - isRegex: false
+          name: mountpoint
+          value: /etc/nfsmount.conf
+    - apiVersion: monitoring.giantswarm.io/v1alpha1
+      kind: Silence
+      metadata:
+        name: ceph-node-local-diskspace-warning
+      spec:
+        matchers:
+        - isRegex: false
+          name: alertname
+          value: CephNodeDiskspaceWarning
+        - isRegex: true
+          name: device
+          value: /dev/sd.*
+    - apiVersion: monitoring.giantswarm.io/v1alpha1
+      kind: Silence
+      metadata:
+        name: expanse-memory-high-utilization
+      spec:
+        matchers:
+        - isRegex: false
+          name: alertname
+          value: NodeMemoryHighUtilization
+        - isRegex: false
+          name: instance
+          value: expanse.internal:9100
+    image:
+      name: quay.io/giantswarm/silence-operator
+    operator:
+      config:
+        alertmanager:
+          address: http://alertmanager.observability.svc.cluster.local:9093
+

@bot-ross
Copy link
Contributor

bot-ross bot commented Dec 30, 2024

--- HelmRelease: observability/silence-operator NetworkPolicy: observability/silence-operator

+++ HelmRelease: observability/silence-operator NetworkPolicy: observability/silence-operator

@@ -0,0 +1,25 @@

+---
+kind: NetworkPolicy
+apiVersion: networking.k8s.io/v1
+metadata:
+  name: silence-operator
+  namespace: observability
+  labels:
+    app.kubernetes.io/name: silence-operator
+    app.kubernetes.io/instance: silence-operator
+    app.kubernetes.io/managed-by: Helm
+spec:
+  podSelector:
+    matchLabels:
+      app.kubernetes.io/name: silence-operator
+      app.kubernetes.io/instance: silence-operator
+  ingress:
+  - ports:
+    - port: 8000
+      protocol: TCP
+  egress:
+  - {}
+  policyTypes:
+  - Egress
+  - Ingress
+
--- HelmRelease: observability/silence-operator ServiceAccount: observability/silence-operator

+++ HelmRelease: observability/silence-operator ServiceAccount: observability/silence-operator

@@ -0,0 +1,11 @@

+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: silence-operator
+  namespace: observability
+  labels:
+    app.kubernetes.io/name: silence-operator
+    app.kubernetes.io/instance: silence-operator
+    app.kubernetes.io/managed-by: Helm
+
--- HelmRelease: observability/silence-operator ConfigMap: observability/silence-operator

+++ HelmRelease: observability/silence-operator ConfigMap: observability/silence-operator

@@ -0,0 +1,29 @@

+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: silence-operator
+  namespace: observability
+  labels:
+    app.kubernetes.io/name: silence-operator
+    app.kubernetes.io/instance: silence-operator
+    app.kubernetes.io/managed-by: Helm
+data:
+  config.yml: |
+    server:
+      enable:
+        debug:
+          server: false
+      listen:
+        address: "http://0.0.0.0:8000"
+    service:
+      alertmanager:
+        address: "http://alertmanager-operated.monitoring:9093"
+      kubernetes:
+        address: ""
+        inCluster: true
+        tls:
+          caFile: ""
+          crtFile: ""
+          keyFile: ""
+
--- HelmRelease: observability/silence-operator Service: observability/silence-operator

+++ HelmRelease: observability/silence-operator Service: observability/silence-operator

@@ -0,0 +1,20 @@

+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: silence-operator
+  namespace: observability
+  labels:
+    app.kubernetes.io/name: silence-operator
+    app.kubernetes.io/instance: silence-operator
+    app.kubernetes.io/managed-by: Helm
+  annotations:
+    prometheus.io/scrape: 'true'
+spec:
+  ports:
+  - port: 8000
+    targetPort: 8000
+  selector:
+    app.kubernetes.io/name: silence-operator
+    app.kubernetes.io/instance: silence-operator
+
--- HelmRelease: observability/silence-operator Deployment: observability/silence-operator

+++ HelmRelease: observability/silence-operator Deployment: observability/silence-operator

@@ -0,0 +1,70 @@

+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: silence-operator
+  namespace: observability
+  labels:
+    app.kubernetes.io/name: silence-operator
+    app.kubernetes.io/instance: silence-operator
+    app.kubernetes.io/managed-by: Helm
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      app.kubernetes.io/name: silence-operator
+      app.kubernetes.io/instance: silence-operator
+  strategy:
+    rollingUpdate: {}
+    type: RollingUpdate
+  template:
+    metadata:
+      labels:
+        app.kubernetes.io/name: silence-operator
+        app.kubernetes.io/instance: silence-operator
+        app.kubernetes.io/managed-by: Helm
+      annotations:
+        releaseRevision: '1'
+    spec:
+      securityContext:
+        fsGroup: 1000
+      volumes:
+      - name: silence-operator-configmap
+        configMap:
+          name: silence-operator
+          items:
+          - key: config.yml
+            path: config.yml
+      serviceAccountName: silence-operator
+      containers:
+      - name: silence-operator
+        image: quay.io/giantswarm/silence-operator:0.12.0
+        imagePullPolicy: IfNotPresent
+        args:
+        - daemon
+        - --config.dirs=/var/run/silence-operator/configmap/
+        - --config.files=config
+        volumeMounts:
+        - name: silence-operator-configmap
+          mountPath: /var/run/silence-operator/configmap/
+        ports:
+        - name: server
+          containerPort: 8000
+        livenessProbe:
+          httpGet:
+            path: /healthz
+            port: 8000
+          initialDelaySeconds: 20
+          periodSeconds: 5
+          timeoutSeconds: 6
+          successThreshold: 1
+          failureThreshold: 5
+        resources:
+          limits: {}
+          requests:
+            cpu: 100m
+            memory: 220Mi
+        securityContext:
+          runAsGroup: 1000
+          runAsUser: 1000
+

@onedr0p onedr0p merged commit a0af22b into main Dec 30, 2024
8 checks passed
@onedr0p onedr0p deleted the silence-operator-ggwp branch December 30, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubernetes Changes made in the kubernetes directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant