I
I
Ivan Vekov2020-12-03 00:42:05
MySQL
Ivan Vekov, 2020-12-03 00:42:05

Why doesn't pod go up from Mysql to Kubernetes?

Good afternoon, there is a minicube, I wanted to connect the application through Helm instead of the manifest stateful set of the database (mainly for practice). Faced a problem. If you just use "helm install my-release bitnami/mysql" - everything is ok. If you register mysql as a dependency, then it constantly restarts. The logs are the same for both.

And so in order:

values.yaml:

spoiler
# Default values for my-app-chart.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

image:
  repository: nginx
  pullPolicy: IfNotPresent
  # Overrides the image tag whose default is the chart appVersion.
  tag: ""

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

serviceAccount:
  # Specifies whether a service account should be created
  create: true
  # Annotations to add to the service account
  annotations: {}
  # The name of the service account to use.
  # If not set and create is true, a name is generated using the fullname template
  name: ""

podAnnotations: {}

podSecurityContext: {}
  # fsGroup: 2000

securityContext: {}
  # capabilities:
  #   drop:
  #   - ALL
  # readOnlyRootFilesystem: true
  # runAsNonRoot: true
  # runAsUser: 1000

service:
  type: NodePort
  port: 80

ingress:
  enabled: false
  annotations: {}
    # kubernetes.io/ingress.class: nginx
    # kubernetes.io/tls-acme: "true"
  hosts:
    - host: chart-example.local
      paths: []
  tls: []
  #  - secretName: chart-example-tls
  #    hosts:
  #      - chart-example.local

resources: {}
  # We usually recommend not to specify default resources and to leave this as a conscious
  # choice for the user. This also increases chances charts run on environments with little
  # resources, such as Minikube. If you do want to specify resources, uncomment the following
  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
  # limits:
  #   cpu: 100m
  #   memory: 128Mi
  # requests:
  #   cpu: 100m
  #   memory: 128Mi

nodeSelector: {}

tolerations: []

affinity: {}

mysql:
  auth:
    rootPassword: 'admin'
  primary:
    service:
     type: NodePort
     port: 3306


Chart.yaml
spoiler
apiVersion: v2
name: my-app-chart
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 1.16.0

dependencies:
  - name: mysql
    repository: https://charts.bitnami.com/bitnami
    version: 8.0.0


Log when running separately (kubectl logs my-release-mysql-0):
spoiler
mysql 21:22:19.24
mysql 21:22:19.25 Welcome to the Bitnami mysql container
mysql 21:22:19.25 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-mysql
mysql 21:22:19.25 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-mysql/issues
mysql 21:22:19.25
mysql 21:22:19.25 INFO  ==> ** Starting MySQL setup **
mysql 21:22:19.27 INFO  ==> Validating settings in MYSQL_*/MARIADB_* env vars
mysql 21:22:19.27 INFO  ==> Initializing mysql database
mysql 21:22:19.29 WARN  ==> The mysql configuration file '/opt/bitnami/mysql/conf/my.cnf' is not writable. Configurations based on environment variables will not be applied for this file.
mysql 21:22:19.29 INFO  ==> Using persisted data
mysql 21:22:19.35 INFO  ==> Running mysql_upgrade
mysql 21:22:19.35 INFO  ==> Starting mysql in background
mysql 21:22:25.38 INFO  ==> Stopping mysql
mysql 21:22:27.39 INFO  ==> ** MySQL setup finished! **

mysql 21:22:27.42 INFO  ==> ** Starting MySQL **
2020-12-02T21:22:27.732603Z 0 [System] [MY-010116] [Server] /opt/bitnami/mysql/bin/mysqld (mysqld 8.0.22) starting as process 1
2020-12-02T21:22:27.736185Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2020-12-02T21:22:27.736196Z 0 [Warning] [MY-013244] [Server] --collation-server: 'utf8_general_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead.
2020-12-02T21:22:27.744279Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-12-02T21:22:27.984163Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2020-12-02T21:22:28.109707Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock
2020-12-02T21:22:28.174829Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2020-12-02T21:22:28.175196Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2020-12-02T21:22:28.198280Z 0 [System] [MY-010931] [Server] /opt/bitnami/mysql/bin/mysqld: ready for connections. Version: '8.0.22'  socket: '/opt/bitnami/mysql/tmp/mysql.sock'  port: 3306  Source distribution.


Log when running through dependency:
spoiler
mysql 21:13:00.69
mysql 21:13:00.69 Welcome to the Bitnami mysql container
mysql 21:13:00.69 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-mysql
mysql 21:13:00.70 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-mysql/issues
mysql 21:13:00.70
mysql 21:13:00.70 INFO  ==> ** Starting MySQL setup **
mysql 21:13:00.72 INFO  ==> Validating settings in MYSQL_*/MARIADB_* env vars
mysql 21:13:00.72 INFO  ==> Initializing mysql database
mysql 21:13:00.74 WARN  ==> The mysql configuration file '/opt/bitnami/mysql/conf/my.cnf' is not writable. Configurations based on environment variables will not be applied for this file.
mysql 21:13:00.74 INFO  ==> Using persisted data
mysql 21:13:00.77 INFO  ==> Running mysql_upgrade
mysql 21:13:00.78 INFO  ==> Starting mysql in background
mysql 21:13:06.82 INFO  ==> Stopping mysql
mysql 21:13:08.83 INFO  ==> ** MySQL setup finished! **

mysql 21:13:08.88 INFO  ==> ** Starting MySQL **
2020-12-02T21:13:09.251265Z 0 [System] [MY-010116] [Server] /opt/bitnami/mysql/bin/mysqld (mysqld 8.0.22) starting as process 1
2020-12-02T21:13:09.255712Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2020-12-02T21:13:09.255723Z 0 [Warning] [MY-013244] [Server] --collation-server: 'utf8_general_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead.
2020-12-02T21:13:09.266094Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-12-02T21:13:09.540193Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2020-12-02T21:13:09.663209Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock
2020-12-02T21:13:09.767010Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2020-12-02T21:13:09.767209Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2020-12-02T21:13:09.806859Z 0 [System] [MY-010931] [Server] /opt/bitnami/mysql/bin/mysqld: ready for connections. Version: '8.0.22'  socket: '/opt/bitnami/mysql/tmp/mysql.sock'  port: 3306  Source distribution.


Anticipating several counter questions:
1) I tried to install another release. Even tried MariaDB.
2) Without NodePort and other husks in values ​​- I also tried it.

I'm suffering for the second night, tell me please.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question