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

Postgres operator connection_pooler_image can't be pulled from private registry #1644

Closed
artur-bolt opened this issue Oct 12, 2021 · 1 comment

Comments

@artur-bolt
Copy link

Hello,

Is there a possibility to pull connection_pooler_image from private registry? Via imagepullsecrets or maybe via serviceaccount (the same way as for postgres-operator)

Thanks!

@artur-bolt
Copy link
Author

artur-bolt commented Oct 14, 2021

Found a workaround by modifying default ServiceAccount:

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  annotations:
    "helm.sh/hook": pre-install
    "helm.sh/hook-weight": "-5"
    "helm.sh/hook-delete-policy": hook-succeeded
  name: default
  namespace: {{ .Release.Namespace }}
rules:
  - apiGroups:
      - ""
    resources:
      - serviceaccounts
    verbs:
      - get
      - patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  annotations:
    "helm.sh/hook": pre-install
    "helm.sh/hook-weight": "-5"
    "helm.sh/hook-delete-policy": hook-succeeded
  name: default
  namespace: {{ .Release.Namespace }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: default
subjects:
  - kind: ServiceAccount
    name: default
    namespace: {{ .Release.Name }}
---
apiVersion: batch/v1
kind: Job
metadata:
  name: patch-sa
  annotations:
    "helm.sh/hook": pre-install
    "helm.sh/hook-delete-policy": hook-succeeded
spec:
  template:
    spec:
      {{- include "Chart.imagePullSecrets" .| nindent 6 }}
      restartPolicy: Never
      containers:
        - name: patch-default-serviceaccount
          image: {{ .Values.global.imageRegistry }}/kubectl:1.19.11
          imagePullPolicy: IfNotPresent
          command: ["/bin/sh", "-c", "kubectl patch serviceaccount default -p '{\"imagePullSecrets\": [{\"name\": \"regcred\"}]}'"]

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

1 participant