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

Running custom-metrics-stackdriver-adapter as non-root user #488

Open
mcantrell opened this issue Oct 27, 2022 · 1 comment
Open

Running custom-metrics-stackdriver-adapter as non-root user #488

mcantrell opened this issue Oct 27, 2022 · 1 comment

Comments

@mcantrell
Copy link

mcantrell commented Oct 27, 2022

Adding a securityContext with non-root settings causes an error:

  securityContext:
    allowPrivilegeEscalation: false
    runAsNonRoot: true
    runAsUser: 1000

allowPrivilegeEscalation: false is fine but runAsNonRoot, runAsUser appear to cause the error:

Unable to get StackdriverAdapter apiserver config error creating self-signed certificates: mkdir apiserver.local.config: permission denied
@Glenn-Terjesen
Copy link

Glenn-Terjesen commented Sep 18, 2023

@mcantrell Hi, we had the same issue, the fix was to change the cert-dir and port number. (+service target change)

      securityContext:
        runAsNonRoot: true
        runAsUser: 65532
        seccompProfile:
          type: RuntimeDefault
      containers:
      - name: pod-custom-metrics-stackdriver-adapter
        imagePullPolicy: Always
        securityContext:
          allowPrivilegeEscalation: false
          runAsNonRoot: true
          capabilities:
            drop:
            - ALL
          seccompProfile:
            type: RuntimeDefault
        ports:
        - name: https
          containerPort: 4443
          protocol: TCP
        command:
        - /adapter
        - --use-new-resource-model=true
        - --cert-dir=/tmp
        - --fallback-for-container-metrics=true
        - --secure-port=4443

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants