Software versions
minikube version: v1.14.0 helm version : v3.4.1 kubectl version : v1.19.2 [server] kubectl version : v1.18.6 [client]
create the helm chart with help pf create command of helm
helm create relayr
add mysql dependency to the Chart.yml file dependencies:
- name: mysql version: chart version repository: repo condition: enable condition
add the dependency details in the vaules.yaml file as well
creating secrets
for creating secrets create a helm_vars directory
add you data to be stored as encrypted
in our case database details are stored
- database password : MYSQLDB_PASSWORD
- database : MYSQL_DATABASE
- database user : MYSQLDB_USER
- database root_password : MYSQL_ROOT_PASSWORD
create the data basesetails save it secrets file in followoing format
mariadb: auth: database: password: username: rootPassword:
once saved generate the pgp key. [which should be installed plugin to be installed ]
add a new file to the helm_vars file named .sops.yaml
-
create gpg key gpg --gen-key
-
gpg --fingerprint to get the finger print
-
creation_rules:
- pgp: 'add the value to the gpg key'
-
encrypt the value in secrets.yaml helm secrets enc ./helm_vars/secrets.yaml
-
you can decrypt and check value helm secrets dec ./helm_vars/secrets.yaml cat value in secrets.yaml.dec
Running the appplication
-
check dependencies helm repo update helm dep update
-
encrypt the secrets
-
check the encrypted values
-
run in debug --dry run mode to check the whole structure helm secrets install appname . -f ./helm_vars/secrets.yaml -f values.yaml --dry-run --debug appname= relayr
Creating presistant volume
- create mysql persistant volume for making the database persistant kubectl apply -f pvcmysql.yaml [file is located outside the helm charts repo]
Accesing the application
-
run minikube
-
access the with http://minikubeip:nodeport
-
create table for database [table name alredy given as hello ] http://minikubeip:nodeport/create_table
-
access http://minikubeip:nodeport/login to add the string to the database table
-
access the data from database with http://minikubeip:nodeport/temp