Closed soosap closed 6 years ago
Hi there, I resolved this problem. I accidentally used the wrong database username. Because it failed to connect to postgres, I obtained this error: uninitialized constant Portus::DB::Mysql2
. It is a bit misleading but my postgres container revealed that someone tried to login with an non-existent user. That's how I spot the mistake. I feel it, I am almost there to see my repos in the portus ui:) Unfortunately, I went from one to another error 🤕 but I will create a separate issue for that.
Description
This is day 3 in which I try to run a portus deployment through Kubernetes and Helm. Since I am only familiar with postgresql I am trying to use that particular
PORTUS_DB_ADAPTER
. I am receiving a series of errors and I am not sure how to resolve them.Steps to reproduce
$ kubectl get po
$ kubectl logs registry-portus-d49564454-txtfz -c portus
Failed to create bus connection: No such file or directory
uninitialized constant Portus::DB::Mysql2
Seems likePORTUS_DB_ADAPTER
postgresql is being ignored. It still tries to connect w/ Mysql2 for some reason. Please help :)Expected behavior: I expected this to happen! No errors.
Actual behavior: But this happened...
COMPUTED VALUES: nginx: config: provided: true global: {} image: pullPolicy: IfNotPresent repository: nginx tag: 1.13.8-alpine replicaCount: 1 service: externalPort: 80 internalPort: 80 type: ClusterIP portus: background: enabled: true resources: requests: cpu: 300m memory: 512Mi config: anonymous_browsing: enabled: false check_ssl_usage: enabled: true delete: enabled: true display_name: enabled: false email: from: portus@company.io name: Portus | C O M P A N Y reply_to: no-reply@company.io smtp: address: smtp.zoho.eu domain: company.io enabled: true port: 465 username: portus@company.io first_user_admin: enabled: true gravatar: enabled: true machine_fqdn: value: registry.company.io signup: enabled: false environment: PORTUS_DB_DATABASE: portus PORTUS_DB_PASSWORD: s3cr3t PORTUS_DB_PORT: 5432 PORTUS_DB_USERNAME: portus PORTUS_EMAIL_SMTP_PASSWORD: s3cr3t global: {} image: pullPolicy: Always repository: portus tag: head ingress: domains:
HOOKS: MANIFEST:
Source: registry/charts/portus/templates/configmap.yaml
apiVersion: v1 kind: ConfigMap metadata: name: registry-portus-config namespace: default data: config-local.yml: | anonymous_browsing: enabled: false check_ssl_usage: enabled: true delete: enabled: true display_name: enabled: false email: from: portus@company.io name: Portus | C O M P A N Y reply_to: no-reply@company.io smtp: address: smtp.zoho.eu domain: company.io enabled: true port: 465 username: portus@company.io first_user_admin: enabled: true gravatar: enabled: true machine_fqdn: value: registry.company.io signup: enabled: false
Source: registry/charts/registry/templates/configmap.yaml
apiVersion: v1 kind: ConfigMap metadata: name: registry-registry-config namespace: default data: config.yml: | health: storagedriver: enabled: false http: addr: :5000 debug: addr: :5001 headers: Access-Control-Allow-Headers:
nosniff log: level: debug storage: delete: enabled: true s3: bucket: company-registry region: eu-central-1 rootdirectory: / version: 0.1
Source: registry/templates/nginx-configmap.yaml
apiVersion: v1 kind: ConfigMap metadata: name: registry-nginx-config labels: app: registry chart: "registry-1.0.0" release: registry heritage: Tiller data: nginx.conf: |
This file is largely based on the one written by @Djelibeybi in:
https://github.com/Djelibeybi/Portus-On-OracleLinux7/
events { worker_connections 1024; } http { default_type application/octet-stream; charset UTF-8;
Some basic config.
server_tokens off; sendfile on; tcp_nopush on; tcp_nodelay on;
On timeouts.
keepalive_timeout 65; client_header_timeout 240; client_body_timeout 240; fastcgi_read_timeout 249; reset_timedout_connection on;
Set a variable to help us decide if we need to add the
'Docker-Distribution-Api-Version' header.
The registry always sets this header.
In the case of nginx performing auth, the header will be unset
since nginx is auth-ing before proxying.
map $upstream_http_docker_distribution_api_version $docker_distribution_api_version { '' 'registry/2.0'; } upstream registry-portus { least_conn; server registry-portus:3000 max_fails=3 fail_timeout=15s; } upstream registry-registry:30000 { least_conn; server registry-registry:30000 max_fails=3 fail_timeout=15s; } server { server_name registry-nginx listen 80 http2;
} }
Source: registry/charts/postgres/templates/volume.yaml
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: registry-postgres-pvc namespace: default spec: accessModes:
ReadWriteOnce storageClassName: aws-ebs-gp2 resources: requests: storage: 2Gi
Source: registry/charts/nginx/templates/service.yaml
apiVersion: v1 kind: Service metadata: name: registry-nginx namespace: default labels: app: nginx chart: nginx-0.1.0 release: registry heritage: Tiller spec: type: ClusterIP ports:
name: nginx-port port: 80 targetPort: 80 protocol: TCP selector: app: nginx release: registry
Source: registry/charts/portus/templates/service.yaml
apiVersion: v1 kind: Service metadata: name: registry-portus namespace: default labels: app: portus chart: portus-0.1.0 release: registry heritage: Tiller spec: type: ClusterIP ports:
name: portus-port port: 3000 targetPort: 3000 protocol: TCP selector: app: portus release: registry
Source: registry/charts/postgres/templates/service.yaml
apiVersion: v1 kind: Service metadata: name: registry-postgres namespace: default labels: app: postgres chart: postgres-0.1.0 release: registry heritage: Tiller spec: type: ClusterIP ports:
name: postgres-port port: 5432 targetPort: 5432 protocol: TCP selector: app: postgres release: registry
Source: registry/charts/registry/templates/service.yaml
apiVersion: v1 kind: Service metadata: name: registry-registry namespace: default labels: app: registry chart: registry-0.1.0 release: registry heritage: Tiller kubernetes.io/cluster-service: "true" kubernetes.io/name: registry spec: type: NodePort ports:
name: debug-port port: 5001 nodePort: 30001 targetPort: debug-port protocol: TCP selector: app: registry release: registry
Source: registry/charts/registry-proxy/templates/daemonset.yaml
apiVersion: extensions/v1beta1 kind: DaemonSet metadata: name: registry-proxy namespace: default labels: app: registry-proxy chart: registry-proxy-0.1.0 release: registry version: v0.4 kubernetes.io/cluster-service: "true" spec: selector: matchLabels: app: registry-proxy release: registry template: metadata: labels: app: registry-proxy release: registry version: v0.4 kubernetes.io/name: registry-proxy kubernetes.io/cluster-service: "true" spec: containers:
effect: NoSchedule key: kops.k8s.io/instancegroup operator: Equal value: builders
Source: registry/charts/nginx/templates/deployment.yaml
apiVersion: extensions/v1beta1 kind: Deployment metadata: name: registry-nginx labels: app: nginx chart: nginx-0.1.0 release: registry heritage: Tiller spec: replicas: 1 template: metadata: labels: app: nginx release: registry spec: containers:
name: config configMap: name: registry-nginx-config
Source: registry/charts/portus/templates/deployment.yaml
apiVersion: apps/v1beta2 kind: Deployment metadata: name: registry-portus namespace: default labels: app: portus chart: portus-0.1.0 release: registry heritage: Tiller spec: replicas: 1 selector: matchLabels: app: portus release: registry template: metadata: labels: app: portus release: registry spec: containers:
name: tls secret: secretName: "tls-registry-portus-cert"
Source: registry/charts/postgres/templates/deployment.yaml
apiVersion: extensions/v1beta1 kind: Deployment metadata: name: registry-postgres namespace: default labels: app: postgres chart: postgres-0.1.0 release: registry heritage: Tiller spec: replicas: 1 template: metadata: labels: app: postgres release: registry spec: containers:
name: postgres-volume persistentVolumeClaim: claimName: registry-postgres-pvc
Source: registry/charts/registry/templates/deployment.yaml
apiVersion: apps/v1beta2 kind: Deployment metadata: name: registry-registry namespace: default labels: app: registry chart: registry-0.1.0 release: registry heritage: Tiller kubernetes.io/cluster-service: "true" spec: replicas: 1 selector: matchLabels: app: registry release: registry template: metadata: labels: app: registry release: registry kubernetes.io/cluster-service: "true" spec: containers: