Use Kubernetes With Helm And Provide My Predefined User And Password With Bitnami Correctly
I am using kubernetes with helm 3.
I need to create a kubernetes pod with sql - creating:
database name: my_database user: root password:12345 port: 3306
The steps: creating chart by:
helm create test
after the chart is created, change the Chart.yaml file in test folder, by adding dependencies section.
apiVersion: v2 name: test3 description: A Helm chart for Kubernetes
- name: mysql version: 8.8.23 repository: "https://charts.bitnami.com/bitnami"
helm dependencies build test
After that there is a compressed file
So I extracted it and there is tar file - I extracted it too, and leave only the final extracted folder.
I presume this isn't the best approach of changing parameter in
and using also the
security.yaml - I would like knowing that better approach too.
I need to change the user + password, and link to database, so I changed the values.yaml directly (any better approach?), for values: auth:rootPassword and auth:my_database.
the another following steps:
helm build dependencies test helm install test --namespace test --create-namespace
after that there are two pods created. I could check it by:
kubectl get pods -n test
and I see two pods running (maybe replication). one of the pod: test-mysql-0 (the other is with random parse).
kubectl exec --stdin --tty test-mysql-0 --namespace test-mysql -- /bin/sh
did enter the pod. run:
mysql -rroot -p12345;
That did showing all the database, including seeing the created database: my_database, successfully.
When I tried openning the
mysql database from 'mysql workbench', and test (same user: root, and password, and port: 3306, and localhost), I couldn't run test (test connection button in database properties returns: 'failed to connect to database').
- Why cannot I run properly 'mysql workbench', while in the pad itself - without any particular problem?
- Is there any better approach than extrating the tgz file as I described above, and can I pass in better way (some secured yaml) the user+password? (Right now is only the root password)
It sounds like you're trying to set the parameters in the dependent chart (please correct me if I'm wrong)
If this is right, all you need to do is add another section in your chart's
name-of-dependency: user-name: ABC password: abcdef
the "name-of-dependency" is specified in your
Chart.yaml file when you declare your chart. For example, here's my redis dependency from one of my own charts
dependencies: - name: redis repository: https://charts.bitnami.com/bitnami/ version: x.x.x
Then when I install the chart, I can override the redis chart's settings by doing this in my own chart's
redis: architecture: standalone auth: password: "secret-password-here"
- → I can't do a foreign key, constraint error
- → How to implement DbDongle::convertTimestamps as workaround of invalid timestamps with MySql strict
- → MySQL error "Foreign key constraint is incorrectly formed"
- → Eloquent Multitable query
- → "Laravel 5.1" add user and project with userId
- → Database backup with custom code in laravel 5 and get the data upto 10 rows from per table in database
- → Laravel 5.1 QueryException when trying to delete a project
- → Using Array in '->where()' for Laravel Query Building
- → Chaining "Count of Columns" of a Method to Single Query Builder
- → Laravel Eloquent Joining Strange query
- → convert time using mysql laravel 5
- → How to update a column after an expiration date in MySQL?
- → Foreign key constraint fails on existing key