Skip to content

Helm with AI

Prompt AmazonQ this text and wait for AI to build the files.

Wordpress setup kubernetes definitions files. Separate files for wordpress app, mysql (needs to be version 8.0), app service, db service, PVC, secret and ingress. PVC should use storage class default, secret file should contain all the db users and db passwords for mysql and wordpress both. Ingress will be nginx with hostname wordpress.alexanderlindholm.net.

7 files should be created:

.
├── mysql-deployment.yaml
├── mysql-pvc.yaml
├── mysql-service.yaml
├── wordpress-deployment.yaml
├── wordpress-ingress.yaml
├── wordpress-pvc.yaml
├── wordpress-secret.yaml
├── wordpress-service.yaml

1 directory, 7 files

Use AmazonQ to read definition files and create the chart for us.

Prompt AmazonQ this text and wait for AI to built the chart.

Create helm charts from these kubernetes definitions file. Use release name in metadata. Replace other hardcoded values into variables and add those variables in values.yaml file.

Check the chart to make sure everything is correct.

Lint the chart

helm lint wordpress-chart
helm template wordpress-chart

if everything looks good launch Kubernetes Chart

helm install wp wordpress-chart -n wp-ns --create-namespace

Get namespace status

helm list -n wp-ns

Get all resources in wp-ns namespace

kubectl get all -n wp-ns

Check ingress status

kubectl get ingress -n wp-ns

Describe ingress

kubectl describe ingress -n wp-ns

Version

If there are new changes to the chart then the version needs to be changed:

vim Chart.yaml
apiVersion: v2
name: wordpress
description: A Helm chart for WordPress with MySQL
type: application
version: 0.1.1 # <-- Change this version
appVersion: "1.0.0"

Upgrade the Kubernetes to use latest changes

helm upgrade wp wordpress-chart -n wp-ns

Get namespace status

helm list -n wp-ns

Get all resources in wp-ns namespace

kubectl get all -n wp-ns

Ask AI to Improve the Code

For Example prompt AI this:

Improve helm charts as per developmental best practices.