Deploying to Minikube with Helm

# Start Minikube
minikube start --cpus 4 --memory 8192

# Our Spring Boot app and 3rd party service (MongoDB, Kafka)
eval $(minikube docker-env)
./gradlew build -x test
docker build -t our-spring-boot-app:v1 .
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm upgrade --install bitnami-mongodb --set auth.rootPassword=root123 bitnami/mongodb -f ./infra/bitnami/mongodb/dev.yaml
helm upgrade --install bitnami-kafka bitnami/kafka -f ./infra/bitnami/kafka/dev.yaml
helm upgrade --install our-spring-boot-app ./infra/our-spring-boot-app -f ./infra/our-spring-boot-app/dev.yaml

# dev.yaml
image:
  repository: our-spring-boot-app
  tag: v1
  pullPolicy: Never
envs:
  PORT: 8080
  HEALTH_PORT: 8081
  SPRING_PROFILES_ACTIVE: dev
  KAFKA_BROKERS: bitnami-kafka.default.svc.cluster.local
  MONGODB_HOST: bitnami-mongodb.default.svc.cluster.local
  MONGODB_PORT: "27017"
  MONGODB_DATABASE: our-spring-boot-app
  MONGODB_USERNAME: root
secretEnvs:
  MONGODB_PASSWORD:
    valueFrom:
      secretKeyRef:
        name: bitnami-mongodb
        key: mongodb-root-password

# Uninstall
helm uninstall our-spring-boot-app
helm uninstall bitnami-mongodb
helm uninstall bitnami-kafka

Leave a Reply

Your email address will not be published. Required fields are marked *