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(helm): Allow provisioner to be namespaced #16091

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

rbrady
Copy link
Contributor

@rbrady rbrady commented Feb 4, 2025

What this PR does / why we need it:

In the Grafana Federal Cloud we have clusters where we cannot create ClusterRole/ClusterRoleBinding due to an increased security posture. To ensure we can deploy the provisioner in these clusters, this PR conditionally generates Role instead of ClusterRole if enterprise and enterprise.provisioner are enabled and rbac.namespaced is true.

This PR also updates the provisioner job helm hooks to allow it to be customized to run on other hookTypes. This still defaults to post-install and should have no impact to current usage. This will allow the Grafana Federal Cloud to use the provisioner after helm post-upgrades to attempt to create tenants as required.

Which issue(s) this PR fixes:
Fixes grafana/deployment_tools#185454.

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

@rbrady rbrady requested a review from a team as a code owner February 4, 2025 17:57
@CLAassistant
Copy link

CLAassistant commented Feb 4, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added area/helm type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories labels Feb 4, 2025
Copy link
Contributor

github-actions bot commented Feb 4, 2025

💻 Deploy preview deleted.

This comment has been minimized.

@rbrady rbrady force-pushed the federal/185454-allow-provisioner-as-namespaced branch 2 times, most recently from 9c5a1e4 to ce43c28 Compare February 4, 2025 18:09
Copy link
Contributor

@davidham davidham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
kind: {{ if not .Values.rbac.namespaced }}Cluster{{ else }}Role{{ end }}Binding
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@rbrady rbrady force-pushed the federal/185454-allow-provisioner-as-namespaced branch from ce43c28 to e89f410 Compare February 6, 2025 15:41

This comment has been minimized.

@rbrady rbrady force-pushed the federal/185454-allow-provisioner-as-namespaced branch from e89f410 to be34c1a Compare February 6, 2025 18:29

This comment has been minimized.

@rbrady rbrady changed the title feat: Allow provisioner to be namespaced feat(helm): Allow provisioner to be namespaced Feb 7, 2025
@rbrady rbrady force-pushed the federal/185454-allow-provisioner-as-namespaced branch from be34c1a to bc2af1f Compare February 7, 2025 19:07

This comment has been minimized.

@rbrady rbrady force-pushed the federal/185454-allow-provisioner-as-namespaced branch 2 times, most recently from 2922d08 to 22ad3d4 Compare February 10, 2025 16:34
In the Grafana Federal Cloud we have clusters where we cannot create ClusterRole/ClusterRoleBinding
due to an increased security posture.  To ensure we can deploy the provisioner in these clusters,
this PR conditionally generates Role instead of ClusterRole if enterprise and enterprise.provisioner
are enabled and rbac.namespaced is true.

This PR also updates the provisioner job helm hooks to allow it to be customized to run on other hookTypes.
This still defaults to post-install and should have no impact to current usage.  This will allow the Grafana
Federal Cloud to use the provisioner after helm post-upgrades to attempt to create tenants as required.

Closes deployment_tools/#185454

Signed-off-by: Ryan Brady <[email protected]>
@rbrady rbrady force-pushed the federal/185454-allow-provisioner-as-namespaced branch from 22ad3d4 to 75db8aa Compare February 11, 2025 18:49
Copy link
Contributor

Helm Diff Output - Summary

Default Values Scenario-diff-output
default, loki-backend, StatefulSet (apps) has changed:
  # Source: loki/templates/backend/statefulset-backend.yaml
  apiVersion: apps/v1
  kind: StatefulSet
  metadata:
    name: loki-backend
    namespace: default
    labels:
      helm.sh/chart: loki-6.25.1
      app.kubernetes.io/name: loki
      app.kubernetes.io/instance: loki-release
      app.kubernetes.io/version: "3.3.2"
      app.kubernetes.io/component: backend
      app.kubernetes.io/part-of: memberlist
  spec:
    replicas: 1
    podManagementPolicy: Parallel
    updateStrategy:
      rollingUpdate:
        partition: 0
    serviceName: loki-backend-headless
    revisionHistoryLimit: 10
    
    persistentVolumeClaimRetentionPolicy:
      whenDeleted: Delete
      whenScaled: Delete
    selector:
      matchLabels:
        app.kubernetes.io/name: loki
        app.kubernetes.io/instance: loki-release
        app.kubernetes.io/component: backend
    template:
      metadata:
        annotations:
          checksum/config: 6074dc4b0d60af4991bb01fbda4550e5e2da5dd9c203362200c280b3e43407ea
        labels:
          app.kubernetes.io/name: loki
          app.kubernetes.io/instance: loki-release
          app.kubernetes.io/component: backend
          app.kubernetes.io/part-of: memberlist
      spec:
        serviceAccountName: loki
        automountServiceAccountToken: true
        
        securityContext:
          fsGroup: 10001
          runAsGroup: 10001
          runAsNonRoot: true
          runAsUser: 10001
        terminationGracePeriodSeconds: 300
        containers:
          - name: loki-sc-rules
-           image: "kiwigrid/k8s-sidecar:1.29.1"
+           image: "kiwigrid/k8s-sidecar:1.30.0"
            imagePullPolicy: IfNotPresent
            env:
              - name: METHOD
                value: WATCH
              - name: LABEL
                value: "loki_rule"
              - name: FOLDER
                value: "/rules"
              - name: RESOURCE
                value: "both"
              - name: WATCH_SERVER_TIMEOUT
                value: "60"
              - name: WATCH_CLIENT_TIMEOUT
                value: "60"
              - name: LOG_LEVEL
                value: "INFO"
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
            volumeMounts:
              - name: sc-rules-volume
                mountPath: "/rules"
          - name: loki
            image: docker.io/grafana/loki:3.3.2
            imagePullPolicy: IfNotPresent
            args:
              - -config.file=/etc/loki/config/config.yaml
              - -target=backend
              - -legacy-read-mode=false
            ports:
              - name: http-metrics
                containerPort: 3100
                protocol: TCP
              - name: grpc
                containerPort: 9095
                protocol: TCP
              - name: http-memberlist
                containerPort: 7946
                protocol: TCP
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
            readinessProbe:
              httpGet:
                path: /ready
                port: http-metrics
              initialDelaySeconds: 30
              timeoutSeconds: 1
            volumeMounts:
              - name: config
                mountPath: /etc/loki/config
              - name: runtime-config
                mountPath: /etc/loki/runtime-config
              - name: tmp
                mountPath: /tmp
              - name: data
                mountPath: /var/loki
              - name: sc-rules-volume
                mountPath: "/rules"
            resources:
              {}
        affinity:
          podAntiAffinity:
            requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchLabels:
                  app.kubernetes.io/component: backend
              topologyKey: kubernetes.io/hostname
        volumes:
          - name: tmp
            emptyDir: {}
          - name: config
            configMap:
              name: loki
              items:
                - key: "config.yaml"
                  path: "config.yaml"
          - name: runtime-config
            configMap:
              name: loki-runtime
          - name: sc-rules-volume
            emptyDir: {}
    volumeClaimTemplates:
      - apiVersion: v1
        kind: PersistentVolumeClaim
        metadata:
          name: data
        spec:
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: "10Gi"
default, loki-release-chunks-cache, StatefulSet (apps) has changed:
  # Source: loki/templates/chunks-cache/statefulset-chunks-cache.yaml
  apiVersion: apps/v1
  kind: StatefulSet
  metadata:
    name: loki-release-chunks-cache
    labels:
      helm.sh/chart: loki-6.25.1
      app.kubernetes.io/name: loki
      app.kubernetes.io/instance: loki-release
      app.kubernetes.io/version: "3.3.2"
      app.kubernetes.io/component: "memcached-chunks-cache"
      name: "memcached-chunks-cache"
    annotations:
      {}
    namespace: "default"
  spec:
    podManagementPolicy: Parallel
    replicas: 1
    selector:
      matchLabels:
        app.kubernetes.io/name: loki
        app.kubernetes.io/instance: loki-release
        app.kubernetes.io/component: "memcached-chunks-cache"
        name: "memcached-chunks-cache"
    updateStrategy:
      type: RollingUpdate
    serviceName: loki-release-chunks-cache

    template:
      metadata:
        labels:
          app.kubernetes.io/name: loki
          app.kubernetes.io/instance: loki-release
          app.kubernetes.io/component: "memcached-chunks-cache"
          name: "memcached-chunks-cache"
        annotations:

      spec:
        serviceAccountName: loki
        securityContext:
          fsGroup: 11211
          runAsGroup: 11211
          runAsNonRoot: true
          runAsUser: 11211
        initContainers:
          []
        nodeSelector:
          {}
        affinity:
          {}
        topologySpreadConstraints:
          []
        tolerations:
          []
        terminationGracePeriodSeconds: 60
        containers:
          - name: memcached
-           image: memcached:1.6.34-alpine
+           image: memcached:1.6.35-alpine
            imagePullPolicy: IfNotPresent
            resources:
              limits:
                memory: 9830Mi
              requests:
                cpu: 500m
                memory: 9830Mi
            ports:
              - containerPort: 11211
                name: client
            args:
              - -m 8192
              - --extended=modern,track_sizes
              - -I 5m
              - -c 16384
              - -v
              - -u 11211
            env:
            envFrom:
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
          - name: exporter
            image: prom/memcached-exporter:v0.15.0
            imagePullPolicy: IfNotPresent
            ports:
              - containerPort: 9150
                name: http-metrics
            args:
              - "--memcached.address=localhost:11211"
              - "--web.listen-address=0.0.0.0:9150"
            resources:
              limits: {}
              requests: {}
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
default, loki-release-results-cache, StatefulSet (apps) has changed:
  # Source: loki/templates/results-cache/statefulset-results-cache.yaml
  apiVersion: apps/v1
  kind: StatefulSet
  metadata:
    name: loki-release-results-cache
    labels:
      helm.sh/chart: loki-6.25.1
      app.kubernetes.io/name: loki
      app.kubernetes.io/instance: loki-release
      app.kubernetes.io/version: "3.3.2"
      app.kubernetes.io/component: "memcached-results-cache"
      name: "memcached-results-cache"
    annotations:
      {}
    namespace: "default"
  spec:
    podManagementPolicy: Parallel
    replicas: 1
    selector:
      matchLabels:
        app.kubernetes.io/name: loki
        app.kubernetes.io/instance: loki-release
        app.kubernetes.io/component: "memcached-results-cache"
        name: "memcached-results-cache"
    updateStrategy:
      type: RollingUpdate
    serviceName: loki-release-results-cache

    template:
      metadata:
        labels:
          app.kubernetes.io/name: loki
          app.kubernetes.io/instance: loki-release
          app.kubernetes.io/component: "memcached-results-cache"
          name: "memcached-results-cache"
        annotations:

      spec:
        serviceAccountName: loki
        securityContext:
          fsGroup: 11211
          runAsGroup: 11211
          runAsNonRoot: true
          runAsUser: 11211
        initContainers:
          []
        nodeSelector:
          {}
        affinity:
          {}
        topologySpreadConstraints:
          []
        tolerations:
          []
        terminationGracePeriodSeconds: 60
        containers:
          - name: memcached
-           image: memcached:1.6.34-alpine
+           image: memcached:1.6.35-alpine
            imagePullPolicy: IfNotPresent
            resources:
              limits:
                memory: 1229Mi
              requests:
                cpu: 500m
                memory: 1229Mi
            ports:
              - containerPort: 11211
                name: client
            args:
              - -m 1024
              - --extended=modern,track_sizes
              - -I 5m
              - -c 16384
              - -v
              - -u 11211
            env:
            envFrom:
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
          - name: exporter
            image: prom/memcached-exporter:v0.15.0
            imagePullPolicy: IfNotPresent
            ports:
              - containerPort: 9150
                name: http-metrics
            args:
              - "--memcached.address=localhost:11211"
              - "--web.listen-address=0.0.0.0:9150"
            resources:
              limits: {}
              requests: {}
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
Ingress Values Scenario-diff-output
default, loki-backend, StatefulSet (apps) has changed:
  # Source: loki/templates/backend/statefulset-backend.yaml
  apiVersion: apps/v1
  kind: StatefulSet
  metadata:
    name: loki-backend
    namespace: default
    labels:
      helm.sh/chart: loki-6.25.1
      app.kubernetes.io/name: loki
      app.kubernetes.io/instance: loki-release
      app.kubernetes.io/version: "3.3.2"
      app.kubernetes.io/component: backend
      app.kubernetes.io/part-of: memberlist
  spec:
    replicas: 1
    podManagementPolicy: Parallel
    updateStrategy:
      rollingUpdate:
        partition: 0
    serviceName: loki-backend-headless
    revisionHistoryLimit: 10
    
    persistentVolumeClaimRetentionPolicy:
      whenDeleted: Delete
      whenScaled: Delete
    selector:
      matchLabels:
        app.kubernetes.io/name: loki
        app.kubernetes.io/instance: loki-release
        app.kubernetes.io/component: backend
    template:
      metadata:
        annotations:
          checksum/config: 6074dc4b0d60af4991bb01fbda4550e5e2da5dd9c203362200c280b3e43407ea
        labels:
          app.kubernetes.io/name: loki
          app.kubernetes.io/instance: loki-release
          app.kubernetes.io/component: backend
          app.kubernetes.io/part-of: memberlist
      spec:
        serviceAccountName: loki
        automountServiceAccountToken: true
        
        securityContext:
          fsGroup: 10001
          runAsGroup: 10001
          runAsNonRoot: true
          runAsUser: 10001
        terminationGracePeriodSeconds: 300
        containers:
          - name: loki-sc-rules
-           image: "kiwigrid/k8s-sidecar:1.29.1"
+           image: "kiwigrid/k8s-sidecar:1.30.0"
            imagePullPolicy: IfNotPresent
            env:
              - name: METHOD
                value: WATCH
              - name: LABEL
                value: "loki_rule"
              - name: FOLDER
                value: "/rules"
              - name: RESOURCE
                value: "both"
              - name: WATCH_SERVER_TIMEOUT
                value: "60"
              - name: WATCH_CLIENT_TIMEOUT
                value: "60"
              - name: LOG_LEVEL
                value: "INFO"
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
            volumeMounts:
              - name: sc-rules-volume
                mountPath: "/rules"
          - name: loki
            image: docker.io/grafana/loki:3.3.2
            imagePullPolicy: IfNotPresent
            args:
              - -config.file=/etc/loki/config/config.yaml
              - -target=backend
              - -legacy-read-mode=false
            ports:
              - name: http-metrics
                containerPort: 3100
                protocol: TCP
              - name: grpc
                containerPort: 9095
                protocol: TCP
              - name: http-memberlist
                containerPort: 7946
                protocol: TCP
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
            readinessProbe:
              httpGet:
                path: /ready
                port: http-metrics
              initialDelaySeconds: 30
              timeoutSeconds: 1
            volumeMounts:
              - name: config
                mountPath: /etc/loki/config
              - name: runtime-config
                mountPath: /etc/loki/runtime-config
              - name: tmp
                mountPath: /tmp
              - name: data
                mountPath: /var/loki
              - name: sc-rules-volume
                mountPath: "/rules"
            resources:
              {}
        affinity:
          podAntiAffinity:
            requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchLabels:
                  app.kubernetes.io/component: backend
              topologyKey: kubernetes.io/hostname
        volumes:
          - name: tmp
            emptyDir: {}
          - name: config
            configMap:
              name: loki
              items:
                - key: "config.yaml"
                  path: "config.yaml"
          - name: runtime-config
            configMap:
              name: loki-runtime
          - name: sc-rules-volume
            emptyDir: {}
    volumeClaimTemplates:
      - apiVersion: v1
        kind: PersistentVolumeClaim
        metadata:
          name: data
        spec:
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: "10Gi"
default, loki-release-chunks-cache, StatefulSet (apps) has changed:
  # Source: loki/templates/chunks-cache/statefulset-chunks-cache.yaml
  apiVersion: apps/v1
  kind: StatefulSet
  metadata:
    name: loki-release-chunks-cache
    labels:
      helm.sh/chart: loki-6.25.1
      app.kubernetes.io/name: loki
      app.kubernetes.io/instance: loki-release
      app.kubernetes.io/version: "3.3.2"
      app.kubernetes.io/component: "memcached-chunks-cache"
      name: "memcached-chunks-cache"
    annotations:
      {}
    namespace: "default"
  spec:
    podManagementPolicy: Parallel
    replicas: 1
    selector:
      matchLabels:
        app.kubernetes.io/name: loki
        app.kubernetes.io/instance: loki-release
        app.kubernetes.io/component: "memcached-chunks-cache"
        name: "memcached-chunks-cache"
    updateStrategy:
      type: RollingUpdate
    serviceName: loki-release-chunks-cache

    template:
      metadata:
        labels:
          app.kubernetes.io/name: loki
          app.kubernetes.io/instance: loki-release
          app.kubernetes.io/component: "memcached-chunks-cache"
          name: "memcached-chunks-cache"
        annotations:

      spec:
        serviceAccountName: loki
        securityContext:
          fsGroup: 11211
          runAsGroup: 11211
          runAsNonRoot: true
          runAsUser: 11211
        initContainers:
          []
        nodeSelector:
          {}
        affinity:
          {}
        topologySpreadConstraints:
          []
        tolerations:
          []
        terminationGracePeriodSeconds: 60
        containers:
          - name: memcached
-           image: memcached:1.6.34-alpine
+           image: memcached:1.6.35-alpine
            imagePullPolicy: IfNotPresent
            resources:
              limits:
                memory: 9830Mi
              requests:
                cpu: 500m
                memory: 9830Mi
            ports:
              - containerPort: 11211
                name: client
            args:
              - -m 8192
              - --extended=modern,track_sizes
              - -I 5m
              - -c 16384
              - -v
              - -u 11211
            env:
            envFrom:
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
          - name: exporter
            image: prom/memcached-exporter:v0.15.0
            imagePullPolicy: IfNotPresent
            ports:
              - containerPort: 9150
                name: http-metrics
            args:
              - "--memcached.address=localhost:11211"
              - "--web.listen-address=0.0.0.0:9150"
            resources:
              limits: {}
              requests: {}
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
default, loki-release-results-cache, StatefulSet (apps) has changed:
  # Source: loki/templates/results-cache/statefulset-results-cache.yaml
  apiVersion: apps/v1
  kind: StatefulSet
  metadata:
    name: loki-release-results-cache
    labels:
      helm.sh/chart: loki-6.25.1
      app.kubernetes.io/name: loki
      app.kubernetes.io/instance: loki-release
      app.kubernetes.io/version: "3.3.2"
      app.kubernetes.io/component: "memcached-results-cache"
      name: "memcached-results-cache"
    annotations:
      {}
    namespace: "default"
  spec:
    podManagementPolicy: Parallel
    replicas: 1
    selector:
      matchLabels:
        app.kubernetes.io/name: loki
        app.kubernetes.io/instance: loki-release
        app.kubernetes.io/component: "memcached-results-cache"
        name: "memcached-results-cache"
    updateStrategy:
      type: RollingUpdate
    serviceName: loki-release-results-cache

    template:
      metadata:
        labels:
          app.kubernetes.io/name: loki
          app.kubernetes.io/instance: loki-release
          app.kubernetes.io/component: "memcached-results-cache"
          name: "memcached-results-cache"
        annotations:

      spec:
        serviceAccountName: loki
        securityContext:
          fsGroup: 11211
          runAsGroup: 11211
          runAsNonRoot: true
          runAsUser: 11211
        initContainers:
          []
        nodeSelector:
          {}
        affinity:
          {}
        topologySpreadConstraints:
          []
        tolerations:
          []
        terminationGracePeriodSeconds: 60
        containers:
          - name: memcached
-           image: memcached:1.6.34-alpine
+           image: memcached:1.6.35-alpine
            imagePullPolicy: IfNotPresent
            resources:
              limits:
                memory: 1229Mi
              requests:
                cpu: 500m
                memory: 1229Mi
            ports:
              - containerPort: 11211
                name: client
            args:
              - -m 1024
              - --extended=modern,track_sizes
              - -I 5m
              - -c 16384
              - -v
              - -u 11211
            env:
            envFrom:
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
          - name: exporter
            image: prom/memcached-exporter:v0.15.0
            imagePullPolicy: IfNotPresent
            ports:
              - containerPort: 9150
                name: http-metrics
            args:
              - "--memcached.address=localhost:11211"
              - "--web.listen-address=0.0.0.0:9150"
            resources:
              limits: {}
              requests: {}
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
Legacy Monitoring Values Scenario-diff-output
default, loki-backend, StatefulSet (apps) has changed:
  # Source: loki/templates/backend/statefulset-backend.yaml
  apiVersion: apps/v1
  kind: StatefulSet
  metadata:
    name: loki-backend
    namespace: default
    labels:
      helm.sh/chart: loki-6.25.1
      app.kubernetes.io/name: loki
      app.kubernetes.io/instance: loki-release
      app.kubernetes.io/version: "3.3.2"
      app.kubernetes.io/component: backend
      app.kubernetes.io/part-of: memberlist
  spec:
    replicas: 1
    podManagementPolicy: Parallel
    updateStrategy:
      rollingUpdate:
        partition: 0
    serviceName: loki-backend-headless
    revisionHistoryLimit: 10
    
    persistentVolumeClaimRetentionPolicy:
      whenDeleted: Delete
      whenScaled: Delete
    selector:
      matchLabels:
        app.kubernetes.io/name: loki
        app.kubernetes.io/instance: loki-release
        app.kubernetes.io/component: backend
    template:
      metadata:
        annotations:
          checksum/config: 6074dc4b0d60af4991bb01fbda4550e5e2da5dd9c203362200c280b3e43407ea
        labels:
          app.kubernetes.io/name: loki
          app.kubernetes.io/instance: loki-release
          app.kubernetes.io/component: backend
          app.kubernetes.io/part-of: memberlist
      spec:
        serviceAccountName: loki
        automountServiceAccountToken: true
        
        securityContext:
          fsGroup: 10001
          runAsGroup: 10001
          runAsNonRoot: true
          runAsUser: 10001
        terminationGracePeriodSeconds: 300
        containers:
          - name: loki-sc-rules
-           image: "kiwigrid/k8s-sidecar:1.29.1"
+           image: "kiwigrid/k8s-sidecar:1.30.0"
            imagePullPolicy: IfNotPresent
            env:
              - name: METHOD
                value: WATCH
              - name: LABEL
                value: "loki_rule"
              - name: FOLDER
                value: "/rules"
              - name: RESOURCE
                value: "both"
              - name: WATCH_SERVER_TIMEOUT
                value: "60"
              - name: WATCH_CLIENT_TIMEOUT
                value: "60"
              - name: LOG_LEVEL
                value: "INFO"
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
            volumeMounts:
              - name: sc-rules-volume
                mountPath: "/rules"
          - name: loki
            image: docker.io/grafana/loki:3.3.2
            imagePullPolicy: IfNotPresent
            args:
              - -config.file=/etc/loki/config/config.yaml
              - -target=backend
              - -legacy-read-mode=false
            ports:
              - name: http-metrics
                containerPort: 3100
                protocol: TCP
              - name: grpc
                containerPort: 9095
                protocol: TCP
              - name: http-memberlist
                containerPort: 7946
                protocol: TCP
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
            readinessProbe:
              httpGet:
                path: /ready
                port: http-metrics
              initialDelaySeconds: 30
              timeoutSeconds: 1
            volumeMounts:
              - name: config
                mountPath: /etc/loki/config
              - name: runtime-config
                mountPath: /etc/loki/runtime-config
              - name: tmp
                mountPath: /tmp
              - name: data
                mountPath: /var/loki
              - name: sc-rules-volume
                mountPath: "/rules"
            resources:
              {}
        affinity:
          podAntiAffinity:
            requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchLabels:
                  app.kubernetes.io/component: backend
              topologyKey: kubernetes.io/hostname
        volumes:
          - name: tmp
            emptyDir: {}
          - name: config
            configMap:
              name: loki
              items:
                - key: "config.yaml"
                  path: "config.yaml"
          - name: runtime-config
            configMap:
              name: loki-runtime
          - name: sc-rules-volume
            emptyDir: {}
    volumeClaimTemplates:
      - apiVersion: v1
        kind: PersistentVolumeClaim
        metadata:
          name: data
        spec:
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: "10Gi"
default, loki-release-chunks-cache, StatefulSet (apps) has changed:
  # Source: loki/templates/chunks-cache/statefulset-chunks-cache.yaml
  apiVersion: apps/v1
  kind: StatefulSet
  metadata:
    name: loki-release-chunks-cache
    labels:
      helm.sh/chart: loki-6.25.1
      app.kubernetes.io/name: loki
      app.kubernetes.io/instance: loki-release
      app.kubernetes.io/version: "3.3.2"
      app.kubernetes.io/component: "memcached-chunks-cache"
      name: "memcached-chunks-cache"
    annotations:
      {}
    namespace: "default"
  spec:
    podManagementPolicy: Parallel
    replicas: 1
    selector:
      matchLabels:
        app.kubernetes.io/name: loki
        app.kubernetes.io/instance: loki-release
        app.kubernetes.io/component: "memcached-chunks-cache"
        name: "memcached-chunks-cache"
    updateStrategy:
      type: RollingUpdate
    serviceName: loki-release-chunks-cache

    template:
      metadata:
        labels:
          app.kubernetes.io/name: loki
          app.kubernetes.io/instance: loki-release
          app.kubernetes.io/component: "memcached-chunks-cache"
          name: "memcached-chunks-cache"
        annotations:

      spec:
        serviceAccountName: loki
        securityContext:
          fsGroup: 11211
          runAsGroup: 11211
          runAsNonRoot: true
          runAsUser: 11211
        initContainers:
          []
        nodeSelector:
          {}
        affinity:
          {}
        topologySpreadConstraints:
          []
        tolerations:
          []
        terminationGracePeriodSeconds: 60
        containers:
          - name: memcached
-           image: memcached:1.6.34-alpine
+           image: memcached:1.6.35-alpine
            imagePullPolicy: IfNotPresent
            resources:
              limits:
                memory: 9830Mi
              requests:
                cpu: 500m
                memory: 9830Mi
            ports:
              - containerPort: 11211
                name: client
            args:
              - -m 8192
              - --extended=modern,track_sizes
              - -I 5m
              - -c 16384
              - -v
              - -u 11211
            env:
            envFrom:
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
          - name: exporter
            image: prom/memcached-exporter:v0.15.0
            imagePullPolicy: IfNotPresent
            ports:
              - containerPort: 9150
                name: http-metrics
            args:
              - "--memcached.address=localhost:11211"
              - "--web.listen-address=0.0.0.0:9150"
            resources:
              limits: {}
              requests: {}
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
default, loki-release-results-cache, StatefulSet (apps) has changed:
  # Source: loki/templates/results-cache/statefulset-results-cache.yaml
  apiVersion: apps/v1
  kind: StatefulSet
  metadata:
    name: loki-release-results-cache
    labels:
      helm.sh/chart: loki-6.25.1
      app.kubernetes.io/name: loki
      app.kubernetes.io/instance: loki-release
      app.kubernetes.io/version: "3.3.2"
      app.kubernetes.io/component: "memcached-results-cache"
      name: "memcached-results-cache"
    annotations:
      {}
    namespace: "default"
  spec:
    podManagementPolicy: Parallel
    replicas: 1
    selector:
      matchLabels:
        app.kubernetes.io/name: loki
        app.kubernetes.io/instance: loki-release
        app.kubernetes.io/component: "memcached-results-cache"
        name: "memcached-results-cache"
    updateStrategy:
      type: RollingUpdate
    serviceName: loki-release-results-cache

    template:
      metadata:
        labels:
          app.kubernetes.io/name: loki
          app.kubernetes.io/instance: loki-release
          app.kubernetes.io/component: "memcached-results-cache"
          name: "memcached-results-cache"
        annotations:

      spec:
        serviceAccountName: loki
        securityContext:
          fsGroup: 11211
          runAsGroup: 11211
          runAsNonRoot: true
          runAsUser: 11211
        initContainers:
          []
        nodeSelector:
          {}
        affinity:
          {}
        topologySpreadConstraints:
          []
        tolerations:
          []
        terminationGracePeriodSeconds: 60
        containers:
          - name: memcached
-           image: memcached:1.6.34-alpine
+           image: memcached:1.6.35-alpine
            imagePullPolicy: IfNotPresent
            resources:
              limits:
                memory: 1229Mi
              requests:
                cpu: 500m
                memory: 1229Mi
            ports:
              - containerPort: 11211
                name: client
            args:
              - -m 1024
              - --extended=modern,track_sizes
              - -I 5m
              - -c 16384
              - -v
              - -u 11211
            env:
            envFrom:
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
          - name: exporter
            image: prom/memcached-exporter:v0.15.0
            imagePullPolicy: IfNotPresent
            ports:
              - containerPort: 9150
                name: http-metrics
            args:
              - "--memcached.address=localhost:11211"
              - "--web.listen-address=0.0.0.0:9150"
            resources:
              limits: {}
              requests: {}
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
Simple Scalable AWS Kube IRSA Values Scenario-diff-output
1142c1142
<           image: "kiwigrid/k8s-sidecar:1.30.0"
---
>           image: "kiwigrid/k8s-sidecar:1.29.1"
1306c1306
<           image: memcached:1.6.35-alpine
---
>           image: memcached:1.6.34-alpine
1408c1408
<           image: memcached:1.6.35-alpine
---
>           image: memcached:1.6.34-alpine
1642a1643,1666
> # Source: loki/templates/provisioner/rolebinding-provisioner.yaml
> apiVersion: rbac.authorization.k8s.io/v1
> kind: ClusterRoleBinding
> metadata:
>   name: enterprise-logs-provisioner
>   namespace: default
>   labels:
>     helm.sh/chart: loki-6.25.1
>     app.kubernetes.io/name: enterprise-logs
>     app.kubernetes.io/instance: loki-release
>     app.kubernetes.io/version: "3.3.2"
>     app.kubernetes.io/component: provisioner
>   annotations:
>     eks.amazonaws.com/role-arn: arn:aws:iam::2222222:role/test-role
>     "helm.sh/hook": post-install
> roleRef:
>   apiGroup: rbac.authorization.k8s.io
>   kind: ClusterRole
>   name: enterprise-logs-provisioner
> subjects:
>   - kind: ServiceAccount
>     name: enterprise-logs-provisioner
>     namespace: default
> ---
1709c1733
<     "helm.sh/hook": "post-install"
---
>     "helm.sh/hook": post-install
1875,1898d1898
< ---
< # Source: loki/templates/provisioner/rolebinding-provisioner.yaml
< apiVersion: rbac.authorization.k8s.io/v1
< kind: ClusterBinding
< metadata:
<   name: enterprise-logs-provisioner
<   namespace: default
<   labels:
<     helm.sh/chart: loki-6.25.1
<     app.kubernetes.io/name: enterprise-logs
<     app.kubernetes.io/instance: loki-release
<     app.kubernetes.io/version: "3.3.2"
<     app.kubernetes.io/component: provisioner
<   annotations:
<     eks.amazonaws.com/role-arn: arn:aws:iam::2222222:role/test-role
<     "helm.sh/hook": post-install
< roleRef:
<   apiGroup: rbac.authorization.k8s.io
<   kind: ClusterRole
<   name: enterprise-logs-provisioner
< subjects:
<   - kind: ServiceAccount
<     name: enterprise-logs-provisioner
<     namespace: default
Simple Thanos Values Scenario-diff-output
520d519
<         prefix: null
522,531c521
<           access_key_id: thanos-minio
<           bucket_name: admin_thanos
<           endpoint: http://minio.minio.svc.cluster.local:9000
<           http:
<             tls_config:
<               insecure_skip_verify: true
<           insecure: true
<           region: us-east-1
<           secret_access_key: thanos-minio123
<           sse: {}
---
>           bucket_name: admin
564,576c554,560
<         object_store:
<           prefix: null
<           s3:
<             access_key_id: thanos-minio
<             bucket_name: chunks_thanos
<             endpoint: http://minio.minio.svc.cluster.local:9000
<             http:
<               tls_config:
<                 insecure_skip_verify: true
<             insecure: true
<             region: us-east-1
<             secret_access_key: thanos-minio123
<             sse: {}
---
>         s3:
>           access_key_id: root-user
>           bucketnames: chunks
>           endpoint: loki-release-minio.default.svc:9000
>           insecure: true
>           s3forcepathstyle: true
>           secret_access_key: supersecretpassword
620,633d603
<     ruler_storage:
<       backend: s3
<       prefix: null
<       s3:
<         access_key_id: thanos-minio
<         bucket_name: ruler_thanos
<         endpoint: http://minio.minio.svc.cluster.local:9000
<         http:
<           tls_config:
<             insecure_skip_verify: true
<         insecure: true
<         region: us-east-1
<         secret_access_key: thanos-minio123
<         sse: {}
1271c1241
<         checksum/config: 1c596ed8933ceee9bd7c5e30b7b4b6b7c8060ceb4c345db76938b297f96a59e4
---
>         checksum/config: 0afeeec017d60fd5bb2d0c8900214e5cdaa121f2c08993d250c03f0821c0d22e
1377c1347
<         checksum/config: 1c596ed8933ceee9bd7c5e30b7b4b6b7c8060ceb4c345db76938b297f96a59e4
---
>         checksum/config: 0afeeec017d60fd5bb2d0c8900214e5cdaa121f2c08993d250c03f0821c0d22e
1481c1451
<         checksum/config: 1c596ed8933ceee9bd7c5e30b7b4b6b7c8060ceb4c345db76938b297f96a59e4
---
>         checksum/config: 0afeeec017d60fd5bb2d0c8900214e5cdaa121f2c08993d250c03f0821c0d22e
1697c1667
<         checksum/config: 1c596ed8933ceee9bd7c5e30b7b4b6b7c8060ceb4c345db76938b297f96a59e4
---
>         checksum/config: 0afeeec017d60fd5bb2d0c8900214e5cdaa121f2c08993d250c03f0821c0d22e
1715c1685
<           image: "kiwigrid/k8s-sidecar:1.30.0"
---
>           image: "kiwigrid/k8s-sidecar:1.29.1"
1878c1848
<           image: memcached:1.6.35-alpine
---
>           image: memcached:1.6.34-alpine
1980c1950
<           image: memcached:1.6.35-alpine
---
>           image: memcached:1.6.34-alpine
2054c2024
<         checksum/config: 1c596ed8933ceee9bd7c5e30b7b4b6b7c8060ceb4c345db76938b297f96a59e4
---
>         checksum/config: 0afeeec017d60fd5bb2d0c8900214e5cdaa121f2c08993d250c03f0821c0d22e
2209a2180,2202
> # Source: loki/templates/provisioner/rolebinding-provisioner.yaml
> apiVersion: rbac.authorization.k8s.io/v1
> kind: ClusterRoleBinding
> metadata:
>   name: enterprise-logs-provisioner
>   namespace: default
>   labels:
>     helm.sh/chart: loki-6.25.1
>     app.kubernetes.io/name: enterprise-logs
>     app.kubernetes.io/instance: loki-release
>     app.kubernetes.io/version: "3.3.2"
>     app.kubernetes.io/component: provisioner
>   annotations:
>     "helm.sh/hook": post-install
> roleRef:
>   apiGroup: rbac.authorization.k8s.io
>   kind: ClusterRole
>   name: enterprise-logs-provisioner
> subjects:
>   - kind: ServiceAccount
>     name: enterprise-logs-provisioner
>     namespace: default
> ---
2348c2341
<     "helm.sh/hook": "post-install"
---
>     "helm.sh/hook": post-install
2510,2532d2502
< ---
< # Source: loki/templates/provisioner/rolebinding-provisioner.yaml
< apiVersion: rbac.authorization.k8s.io/v1
< kind: ClusterBinding
< metadata:
<   name: enterprise-logs-provisioner
<   namespace: default
<   labels:
<     helm.sh/chart: loki-6.25.1
<     app.kubernetes.io/name: enterprise-logs
<     app.kubernetes.io/instance: loki-release
<     app.kubernetes.io/version: "3.3.2"
<     app.kubernetes.io/component: provisioner
<   annotations:
<     "helm.sh/hook": post-install
< roleRef:
<   apiGroup: rbac.authorization.k8s.io
<   kind: ClusterRole
<   name: enterprise-logs-provisioner
< subjects:
<   - kind: ServiceAccount
<     name: enterprise-logs-provisioner
<     namespace: default
Single Binary Scenario-diff-output
default, loki-release-chunks-cache, StatefulSet (apps) has changed:
  # Source: loki/templates/chunks-cache/statefulset-chunks-cache.yaml
  apiVersion: apps/v1
  kind: StatefulSet
  metadata:
    name: loki-release-chunks-cache
    labels:
      helm.sh/chart: loki-6.25.1
      app.kubernetes.io/name: loki
      app.kubernetes.io/instance: loki-release
      app.kubernetes.io/version: "3.3.2"
      app.kubernetes.io/component: "memcached-chunks-cache"
      name: "memcached-chunks-cache"
    annotations:
      {}
    namespace: "default"
  spec:
    podManagementPolicy: Parallel
    replicas: 1
    selector:
      matchLabels:
        app.kubernetes.io/name: loki
        app.kubernetes.io/instance: loki-release
        app.kubernetes.io/component: "memcached-chunks-cache"
        name: "memcached-chunks-cache"
    updateStrategy:
      type: RollingUpdate
    serviceName: loki-release-chunks-cache

    template:
      metadata:
        labels:
          app.kubernetes.io/name: loki
          app.kubernetes.io/instance: loki-release
          app.kubernetes.io/component: "memcached-chunks-cache"
          name: "memcached-chunks-cache"
        annotations:

      spec:
        serviceAccountName: loki
        securityContext:
          fsGroup: 11211
          runAsGroup: 11211
          runAsNonRoot: true
          runAsUser: 11211
        initContainers:
          []
        nodeSelector:
          {}
        affinity:
          {}
        topologySpreadConstraints:
          []
        tolerations:
          []
        terminationGracePeriodSeconds: 60
        containers:
          - name: memcached
-           image: memcached:1.6.34-alpine
+           image: memcached:1.6.35-alpine
            imagePullPolicy: IfNotPresent
            resources:
              limits:
                memory: 9830Mi
              requests:
                cpu: 500m
                memory: 9830Mi
            ports:
              - containerPort: 11211
                name: client
            args:
              - -m 8192
              - --extended=modern,track_sizes
              - -I 5m
              - -c 16384
              - -v
              - -u 11211
            env:
            envFrom:
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
          - name: exporter
            image: prom/memcached-exporter:v0.15.0
            imagePullPolicy: IfNotPresent
            ports:
              - containerPort: 9150
                name: http-metrics
            args:
              - "--memcached.address=localhost:11211"
              - "--web.listen-address=0.0.0.0:9150"
            resources:
              limits: {}
              requests: {}
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
default, loki-release-results-cache, StatefulSet (apps) has changed:
  # Source: loki/templates/results-cache/statefulset-results-cache.yaml
  apiVersion: apps/v1
  kind: StatefulSet
  metadata:
    name: loki-release-results-cache
    labels:
      helm.sh/chart: loki-6.25.1
      app.kubernetes.io/name: loki
      app.kubernetes.io/instance: loki-release
      app.kubernetes.io/version: "3.3.2"
      app.kubernetes.io/component: "memcached-results-cache"
      name: "memcached-results-cache"
    annotations:
      {}
    namespace: "default"
  spec:
    podManagementPolicy: Parallel
    replicas: 1
    selector:
      matchLabels:
        app.kubernetes.io/name: loki
        app.kubernetes.io/instance: loki-release
        app.kubernetes.io/component: "memcached-results-cache"
        name: "memcached-results-cache"
    updateStrategy:
      type: RollingUpdate
    serviceName: loki-release-results-cache

    template:
      metadata:
        labels:
          app.kubernetes.io/name: loki
          app.kubernetes.io/instance: loki-release
          app.kubernetes.io/component: "memcached-results-cache"
          name: "memcached-results-cache"
        annotations:

      spec:
        serviceAccountName: loki
        securityContext:
          fsGroup: 11211
          runAsGroup: 11211
          runAsNonRoot: true
          runAsUser: 11211
        initContainers:
          []
        nodeSelector:
          {}
        affinity:
          {}
        topologySpreadConstraints:
          []
        tolerations:
          []
        terminationGracePeriodSeconds: 60
        containers:
          - name: memcached
-           image: memcached:1.6.34-alpine
+           image: memcached:1.6.35-alpine
            imagePullPolicy: IfNotPresent
            resources:
              limits:
                memory: 1229Mi
              requests:
                cpu: 500m
                memory: 1229Mi
            ports:
              - containerPort: 11211
                name: client
            args:
              - -m 1024
              - --extended=modern,track_sizes
              - -I 5m
              - -c 16384
              - -v
              - -u 11211
            env:
            envFrom:
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
          - name: exporter
            image: prom/memcached-exporter:v0.15.0
            imagePullPolicy: IfNotPresent
            ports:
              - containerPort: 9150
                name: http-metrics
            args:
              - "--memcached.address=localhost:11211"
              - "--web.listen-address=0.0.0.0:9150"
            resources:
              limits: {}
              requests: {}
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true

@slim-bean slim-bean merged commit af85ecf into main Feb 12, 2025
70 checks passed
@slim-bean slim-bean deleted the federal/185454-allow-provisioner-as-namespaced branch February 12, 2025 02:17
salvacorts pushed a commit that referenced this pull request Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/helm size/S type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants