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

Atlas Operator unable to connect to MySQL database with Istio enabled #3286

Open
tombojer opened this issue Dec 27, 2024 · 1 comment
Open

Comments

@tombojer
Copy link

I am trying to apply the AtlasSchema below with the help of the Atlas Operator.

As you can see in the Events, the Operator is unable to connect to the temporary database.

When I disable istio in the namespace, the connection can be created successfully and the schema gets applied.

API Version:  db.atlasgo.io/v1alpha1
Kind:         AtlasSchema
Metadata:
  Creation Timestamp:  2024-09-19T12:45:17Z
  Generation:          4
  Resource Version:    92394556
  UID:                 79376da7-8eb5-4c64-b807-34b561ea5383
Spec:
  Credentials:
    Host From:
      Secret Key Ref:
        Key:   endpoint
        Name:  connection-secret
    Password From:
      Secret Key Ref:
        Key:   password
        Name:  connection-secret
    Port:      3306
    Scheme:    mysql
    User:      root
  Schema:
    Config Map Key Ref:
      Key:   schema.hcl
      Name:  schema
  Tx Mode:   file
Status:
  Conditions:
    Last Transition Time:  2024-12-03T11:48:47Z
    Message:               [mysql] 2024/12/27 13:01:14 packets.go:37: unexpected EOF
[mysql] 2024/12/27 13:01:14 packets.go:37: unexpected EOF
[mysql] 2024/12/27 13:01:14 packets.go:37: unexpected EOF
Error: mysql: query system variables: driver: bad connection
    Reason:       ApplyingSchema
    Status:       False
    Type:         Ready
  last_applied:   1733145188
  observed_hash:  6104db4461bd6c2515dce7ab2a746ea581cfae460eff2163b9488f31c3c29803
Events:
  Type     Reason          Age   From                    Message
  ----     ------          ----  ----                    -------
  Warning  ApplyingSchema  9m1s  atlasschema-controller  [mysql] 2024/12/27 11:08:39 packets.go:37: unexpected EOF
[mysql] 2024/12/27 12:08:39 packets.go:37: unexpected EOF
[mysql] 2024/12/27 13:01:14 packets.go:37: unexpected EOF
Error: mysql: query system variables: driver: bad connection
  Warning  TransientErr  9m1s  atlasschema-controller  [mysql] 2024/12/27 11:08:39 packets.go:37: unexpected EOF
[mysql] 2024/12/27 12:08:39 packets.go:37: unexpected EOF
[mysql] 2024/12/27 13:01:14 packets.go:37: unexpected EOF
Error: mysql: query system variables: driver: bad connection
  Warning  ApplyingSchema  9m1s  atlasschema-controller  [mysql] 2024/12/27 13:01:14 packets.go:37: unexpected EOF
[mysql] 2024/12/27 13:01:14 packets.go:37: unexpected EOF
[mysql] 2024/12/27 13:01:14 packets.go:37: unexpected EOF
Error: mysql: query system variables: driver: bad connection
  Warning  TransientErr  9m1s  atlasschema-controller  [mysql] 2024/12/27 13:01:14 packets.go:37: unexpected EOF
[mysql] 2024/12/27 13:01:14 packets.go:37: unexpected EOF
[mysql] 2024/12/27 13:01:14 packets.go:37: unexpected EOF
Error: mysql: query system variables: driver: bad connection

Possible Workaround

By adding the label istio-injection=disabled to the namespace istio sidecards are no longer injected and everything works fine.

Unfortunately you need to disable istio in the whole namespace because it is not possible to set custom labels to the database pod that is created by the Atlas Operator.

@tombojer
Copy link
Author

tombojer commented Dec 27, 2024

I could add something like that to the operator if you want to.

tombojer/atlas-operator@a2d0f43

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