Giter VIP home page Giter VIP logo

helm-pgadmin's Introduction

⚠️ As explained in Issue #18, this repository is now archived. Please use https://github.com/helm/charts/tree/master/stable/pgadmin instead. Thanks you all for the contributions made to this Helm Chart! ⚠️

Helm Chart for pgAdmin

CircleCI License version

Introduction

This Helm chart installs pgAdmin in a Kubernetes cluster.

Prerequisites

  • Kubernetes cluster 1.10+
  • Helm 2.8.0+
  • PV provisioner support in the underlying infrastructure.

Installation

Add Helm repository

helm repo add cetic https://cetic.github.io/helm-charts
helm repo update

Configure the chart

The following items can be set via --set flag during installation or configured by editing the values.yaml directly (need to download the chart first).

Configure the way how to expose pgAdmin service:

  • Ingress: The ingress controller must be installed in the Kubernetes cluster.
  • ClusterIP: Exposes the service on a cluster-internal IP. Choosing this value makes the service only reachable from within the cluster.
  • NodePort: Exposes the service on each Node’s IP at a static port (the NodePort). You’ll be able to contact the NodePort service, from outside the cluster, by requesting NodeIP:NodePort.
  • LoadBalancer: Exposes the service externally using a cloud provider’s load balancer.

Configure the way how to persistent data:

  • Disable: The data does not survive the termination of a pod.
  • Persistent Volume Claim(default): A default StorageClass is needed in the Kubernetes cluster to dynamic provision the volumes. Specify another StorageClass in the storageClass or set existingClaim if you have already existing persistent volumes to use.

Install the chart

Install the pgAdmin helm chart with a release name my-release:

helm install --name my-release cetic/pgadmin

Uninstallation

To uninstall/delete the my-release deployment:

helm delete --purge my-release

Configuration

The following table lists the configurable parameters of the pgAdmin chart and the default values.

Parameter Description Default
Image
image.repository pgAdmin Image name dpage/pgadmin4
image.tag pgAdmin Image tag 4.13
image.pullPolicy pgAdmin Image pull policy IfNotPresent
PgAdmin
pgadmin.username pgAdmin admin user [email protected]
pgadmin.password pgAdmin admin password admin
pgadmin.existingPasswordSecret existing secret containing pgAdmin admin password nil
pgadmin.tls pgAdmin admin TLS. the container will listen on port 80 for connections in plain text. If set to any value, the container will listen on port 443 for TLS connections. When TLS is enabled, a certificate and key must be provided. See secrets file false
pgadmin.scriptname pgAdmin ScriptName Env, See https://www.pgadmin.org/docs/pgadmin4/latest/container_deployment.html nil
pgadmin.config pgAdmin configuration override(s) Env, config.py entries can be overriden by environment variables with the prefix: 'PGADMIN_CONFIG_' nil
Persistence
persistence.enabled Enable the data persistence or not true
persistence.existingClaim Provide an existing PersistentVolumeClaim, the value is evaluated as a template nil
persistence.storageClass PVC Storage Class for PostgreSQL volume nil
persistence.accessMode The access mode of the volume ReadWriteOnce
persistence.size The size of the volume 4Gi
Service
service.type Type of service for pgAdmin frontend LoadBalancer
service.port Port to expose service 80
service.tlsport Port to expose service in tls, pgadmin.tlsmust be enabled 443
service.loadBalancerIP LoadBalancerIP if service type is LoadBalancer nil
service.loadBalancerSourceRanges Address that are allowed when svc is LoadBalancer []
service.annotations Service annotations {}
Ingress
ingress.enabled Enables Ingress false
ingress.annotations Ingress annotations {}
ingress.path Path to access frontend /
ingress.hosts Ingress hosts []
ingress.tls Ingress TLS configuration []
Servers
servers.enabled Enable the servers configuration. If enabled, server definitions found in servers.config will be loaded at launch time. true
servers.config Server definitions See the values.yaml
ReadinessProbe
readinessProbe Rediness Probe settings nil
LivenessProbe
livenessProbe Liveness Probe settings nil
Resources
resources CPU/Memory resource requests/limits {}

Credits

Initially inspired from https://github.com/jjcollinge/pgadmin-chart, which is archived.

Contributing

Feel free to contribute by making a pull request.

Please read the official Contribution Guide from Helm for more information on how you can contribute to this Chart.

License

Apache License 2.0

helm-pgadmin's People

Contributors

alexnuttinck avatar anebi avatar mirzakhany avatar nicorikken avatar patkearney avatar yujunz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

helm-pgadmin's Issues

Feature request: Mount servers.json file

Feature Request

Add the possibility to modify the "servers.json" file to pre-configure connection informations:

See https://hub.docker.com/r/dpage/pgadmin4:

If this file is mapped, server definitions found in it will be loaded at launch time. This allows connection information to be pre-loaded into the instance of pgAdmin in the container. Note that server definitions are only loaded on first launch, i.e. when the configuration database is created, and not on subsequent launches using the same configuration database. Note that server definitions are only loaded on first launch, i.e. when the configuration database is created, and not on subsequent launches using the same configuration database.

It could be achieved through a ConfigMap.

[cetic/pgadmin] Q : how to set default Path

I am installing Pgadmin on my cluster and I have ingress sys that works fine for other components. But, with pgadmin I need to set a root_url or basePath threw value.yamls in order to get to the service after initial request.
My first navigation is set to trigger the service with "https://aws-aws-aws.somthing/app/pgadmin"
But after I do get to the service I am being redirected to root URL of the service which is /, thus I find my self on -"https://aws-aws-aws.somthing/_login?next=%2F_"

Version of Helm and Kubernetes:
Helm : 2.14.1
K8s: 1.16.2

What you expected to happen:

My expectation is to reach "https://aws-aws-aws.somthing/app/pgadmin/_login?next=%2F_"

PS
I am not using the ingress set up of the values.yaml
Just like any other of my services like : grafana cerebro or kibana
Thanks!

support existingSecret pattern

The chart currently only supports a default admin password by defining it in the values.yaml. I want to provide a more secure password, but don't want to do so in plaintext in the values.yaml, but rather create one from a sealed secret.
To support this use-case, I want to add the existingSecret pattern to the chart, which also allows you to define the name of a secret that is already supposed to be in the cluster.

By introducing a helper, the proper default fallback can be included.

[cetic/pgadmin] Unable to start pgadmin

With default parameters for the pv, on the kubernetes cluster getting following error:

Traceback (most recent call last):
  File "run_pgadmin.py", line 4, in <module>
    from pgAdmin4 import app
  File "/pgadmin4/pgAdmin4.py", line 109, in <module>
    app = create_app()
  File "/pgadmin4/pgadmin/__init__.py", line 244, in create_app
    create_app_data_directory(config)
  File "/pgadmin4/pgadmin/setup/data_directory.py", line 40, in create_app_data_directory
    _create_directory_if_not_exists(config.SESSION_DB_PATH)
  File "/pgadmin4/pgadmin/setup/data_directory.py", line 16, in _create_directory_if_not_exists
    os.mkdir(_path)
PermissionError: [Errno 13] Permission denied: '/var/lib/pgadmin/sessions'
[2020-01-09 12:06:45 +0000] [1] [INFO] Starting gunicorn 19.9.0
[2020-01-09 12:06:45 +0000] [1] [INFO] Listening at: http://[::]:80 (1)
[2020-01-09 12:06:45 +0000] [1] [INFO] Using worker: threads
[2020-01-09 12:06:45 +0000] [19] [INFO] Booting worker with pid: 19
[2020-01-09 12:06:46 +0000] [19] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
    worker.init_process()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/gthread.py", line 104, in init_process
    super(ThreadWorker, self).init_process()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
    self.load_wsgi()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
    return self.load_wsgiapp()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 350, in import_app
    __import__(module)
  File "/pgadmin4/run_pgadmin.py", line 4, in <module>
    from pgAdmin4 import app
  File "/pgadmin4/pgAdmin4.py", line 109, in <module>
    app = create_app()
  File "/pgadmin4/pgadmin/__init__.py", line 244, in create_app
    create_app_data_directory(config)
  File "/pgadmin4/pgadmin/setup/data_directory.py", line 40, in create_app_data_directory
    _create_directory_if_not_exists(config.SESSION_DB_PATH)
  File "/pgadmin4/pgadmin/setup/data_directory.py", line 16, in _create_directory_if_not_exists
    os.mkdir(_path)
PermissionError: [Errno 13] Permission denied: '/var/lib/pgadmin/sessions'
[2020-01-09 12:06:46 +0000] [19] [INFO] Worker exiting (pid: 19)
WARNING: Failed to set ACL on the directory containing the configuration database: [Errno 1] Operation not permitted: '/var/lib/pgadmin'
[2020-01-09 12:06:46 +0000] [1] [INFO] Shutting down: Master
[2020-01-09 12:06:46 +0000] [1] [INFO] Reason: Worker failed to boot.

Here are the values that are used:

image:
  repository: dpage/pgadmin4
  tag: 4.17
  pullPolicy: IfNotPresent

service:
  type: ClusterIP

pgadmin:
  username: [email protected]
  password: test123
  tls: false
  scriptname: /pgadmin

readinessProbe:
 httpGet:
   path: /
   port: http
 initialDelaySeconds: 60
 periodSeconds: 15
 timeoutSeconds: 10
livenessProbe:
  httpGet:
    path: /
    port: http
  initialDelaySeconds: 60
  periodSeconds: 30
  timeoutSeconds: 10

Image tag is not respected

The chart doesn't respect the image.tag property:

For now I've used this workaround:

  image:
    # FIXME: temporary fix to fixate to a version tag
    repository: dpage/pgadmin4:4.13  # included tag here
    tag: 4.13  # is ignored
    pullPolicy: IfNotPresent

Add LDAP support

Add LDAP support to the chart (currently pgadmin uses default credentials)

4.17 image cannot connect to port 80

4.17 image cannot connect to port 80:

[2020-01-23 09:19:58 +0000] [1] [INFO] Starting gunicorn 19.9.0
[2020-01-23 09:19:58 +0000] [1] [ERROR] Retrying in 1 second.
[2020-01-23 09:19:59 +0000] [1] [ERROR] Retrying in 1 second.
[2020-01-23 09:20:00 +0000] [1] [ERROR] Retrying in 1 second.
[2020-01-23 09:20:01 +0000] [1] [ERROR] Retrying in 1 second.
[2020-01-23 09:20:02 +0000] [1] [ERROR] Retrying in 1 second.
[2020-01-23 09:20:03 +0000] [1] [ERROR] Can't connect to ('::', 80)

ValueError: invalid literal for int() with base 10

Hello,

I try to install pgadmin using your chart. I set service.type to be ClusterIP and port 80. I plan to use ingress controller in order to access pgadmin, but I get following error:

[2019-07-11 13:38:28 +0000] [1] [INFO] Starting gunicorn 19.9.0 [2019-07-11 13:38:28 +0000] [1] [INFO] Listening at: http://[::]:80 (1) [2019-07-11 13:38:28 +0000] [1] [INFO] Using worker: threads [2019-07-11 13:38:28 +0000] [76] [INFO] Booting worker with pid: 76 [2019-07-11 13:38:33 +0000] [76] [ERROR] Exception in worker process Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker worker.init_process() File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/gthread.py", line 104, in init_process super(ThreadWorker, self).init_process() File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 129, in init_process self.load_wsgi() File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi self.wsgi = self.app.wsgi() File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi self.callable = self.load() File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load return self.load_wsgiapp() File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 350, in import_app __import__(module) File "/pgadmin4/run_pgadmin.py", line 4, in <module> from pgAdmin4 import app File "/pgadmin4/pgAdmin4.py", line 131, in <module> server_port = int(port) ValueError: invalid literal for int() with base 10: 'tcp://10.43.140.25:80' [2019-07-11 13:38:33 +0000] [76] [INFO] Worker exiting (pid: 76) [2019-07-11 13:38:33 +0000] [1] [INFO] Shutting down: Master [2019-07-11 13:38:33 +0000] [1] [INFO] Reason: Worker failed to boot.

How can I solve this?

Thank you in advance!

Best regards,
Ali Nebi

persistence.existingClaim is not considered

Although there is a persistence.existingClaim value defined, it is not used in the actual Deployment template.

      volumes:
        - name: pgadmin-data
         {{- if .Values.persistence.enabled }}
          persistentVolumeClaim:
            claimName: {{ template "pgadmin.fullname" . }}
         {{- else }}
          emptyDir: {}
         {{- end }}
         {{- if .Values.pgadmin.tls }}
        - name: tls-private-key
          secret:
            secretName: {{ template "pgadmin.fullname" . }}
            items:
              - key: server.key
                path: server.key

[Question] cetic/helm-pgadmin - How to connect to service

Describe the bug
I am fairly new to kubernetes and pgadmin. I have a cluster running in GKE and I have deployed a postgres cluster using https://github.com/zalando/postgres-operator. I have successfully deployed the pgadmin application, logged in and now trying to add a server.

Version of Helm and Kubernetes:
Chart: 0.1.10
Helm: v2.14.2
K8s: v1.13.7-gke.15

What happened:
Not sure how to connect to postgres instance, i tried using the name of the kubernetes service but did not work. I instead got error message server connection closed. (Apologies I took a screenshot before uninstalling and I thought it was of the error but it was not)

Screenshot 2019-10-05 at 08 40 36

I also noticed in the browser console there were errors about unauthorized, not sure what that is related to

What you expected to happen:
Successful connection to database :)

How to reproduce it (as minimally and precisely as possible):
Install latest helm chart with supplementary values file:

---
pgadmin:
  ## pgadmin admin user
  username: my-username
  ## pgadmin admin password
  password: my-password
  ## pgadmin config, Any custom environment variabls. Settings in config.py can be overriden with an environment variable using the prefix: PGADMIN_CONFIG_
  ## eg turn off enhanced cookie protection for default AKS, loadbalancer installation
  config:
    - name: "PGADMIN_CONFIG_ENHANCED_COOKIE_PROTECTION"
      value: "False"
      
## Expose the pgAdmin service to be accessed from outside the cluster (LoadBalancer service).
## or access it from within the cluster (ClusterIP service). Set the service type and the port to serve it.
## ref: http://kubernetes.io/docs/user-guide/services/
##
service:
  name: my-service-name

Anything else we need to know:
I am also running istio, so I am connecting to pgadmin using a virtual service

I am not sure how to connect to the postgres instance. I am not sure if pgadmin is trying to connect from within the cluster if so I assumed the service name would resolve to correct pod or if postgres service has to be exposed to outside traffic. Any information on this such as service type would be helpful.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.