Has anyone successfully deployed Bitbucket Auto Runners on K8s using API tokens? Any advice on troubleshooting this 401 error would be greatly appreciated – especially if it's a common gotcha with token scopes or endpoint compatibility. It works with app password, however app password will be deprecated. The error:
Unauthorized. Check your bitbucket credentials. Status code 401: {"type": "error", "error": { "message": "Token is invalid, expired, or not supported for this endpoint." }}
I'm using this links:
base64 encode: https://support.atlassian.com/bitbucket-cloud/docs/autoscaler-for-runners-on-kubernetes/
I'm following this link: https://community.atlassian.com/forums/Bitbucket-questions/Bitbucket-runners-autoscaler-doesn-t-accept-API-Token/qaq-p/3084658
My kustomization.yaml:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base
configMapGenerator:
- name: runners-autoscaler-config
files:
- runners_config.yaml
options:
disableNameSuffixHash: true
runners_config.yaml.
namespace: bitbucket-runner-control-plane
commonLabels:
app.kubernetes.io/part-of: runners-autoscaler
images:
- name: bitbucketpipelines/runners-autoscaler
newTag: 3.9.0
patches:
- target:
version: v1
kind: Secret
name: runner-bitbucket-credentials
patch: |-
- op: add
path: /data/atlassianAccountEmail
value: "my_account_email_in_base64"
- op: add
path: /data/atlassianApiToken
value: "my_api_token_in_base64"
- target:
version: v1
kind: Deployment
labelSelector: "inject=runners-autoscaler-envs"
patch: |-
- op: replace
path: /spec/template/spec/containers/0/env
value:
- name: ATLASSIAN_ACCOUNT_EMAIL
valueFrom:
secretKeyRef:
key: atlassianAccountEmail
name: runner-bitbucket-credentials
- name: ATLASSIAN_API_TOKEN
valueFrom:
secretKeyRef:
key: atlassianApiToken
name: runner-bitbucket-credentials
I created this api key (the last accessed field was changed when I tried to run the autoscaler):
