DevOps Bootcamp · Lesson

Install-or-Upgrade with --install

The idempotent upgrade -i pattern for automation.

Lesson 2 of 413 steps

Install-or-Upgrade with --install is a free DevOps Bootcamp lesson on CoddyKit. This is lesson 2 of 4. Any 3 lessons of this learning path are free to read in full — after that, CoddyKit PRO unlocks every lesson, plus hands-on practice with a built-in code editor and a 24/7 AI tutor. It is part of the DevOps Bootcamp learning path, and your progress syncs across the web and the CoddyKit app. The DevOps Bootcamp course includes 4 lessons in total.

The Chicken-and-Egg Problem

Plain helm upgrade fails if the release does not exist yet. In automation you often cannot be sure whether it is the first run or the tenth.

Meet --install

The --install flag fixes this: upgrade the release if it exists, otherwise install it fresh. One command covers both cases.

helm upgrade --install my-app bitnami/nginx

The Short Form -i

You will see this written as -i, the short alias for --install. The two forms behave identically.

helm upgrade -i my-app bitnami/nginx

Why It Means Idempotent

Run it once or run it ten times with the same inputs and you converge to the same state. That idempotent behavior is gold for scripts.

Built for Pipelines

CI/CD jobs cannot branch on whether a release already exists. With upgrade --install, the same deploy step works on every run. 🤖

Values Still Apply

All the usual flags work here. Combine --set or -f exactly as you would with a normal install or upgrade.

helm upgrade -i my-app bitnami/nginx -f prod-values.yaml

Create the Namespace Too

On a first install the target namespace may not exist. Add --create-namespace so the very first run never trips over a missing namespace.

helm upgrade -i my-app bitnami/nginx -n web --create-namespace

Pair It With --atomic

For safe automated deploys, combine --atomic with --install so a failed run cleans up after itself on either path.

helm upgrade -i my-app bitnami/nginx --atomic

First Run Is Revision 1

When --install actually installs, that counts as revision 1, just like a normal helm install. Later runs upgrade and bump the number.

Still Preview With --dry-run

Unsure what an automated step will do on a fresh cluster? Add --dry-run to see the rendered result without touching anything.

helm upgrade -i my-app bitnami/nginx --dry-run

A Common One-Liner

This single, repeatable command is the backbone of many deploy scripts: it installs or upgrades, creates the namespace, and self-heals on failure. ✅

helm upgrade -i my-app ./chart -n web --create-namespace --atomic

Quick Check

Your deploy job runs the same command on a brand-new cluster and on an existing one. What does helm upgrade --install do?

Recap

You learned the idempotent upgrade --install (or -i) pattern: one command that installs or upgrades, perfect for automation. Add --create-namespace and --atomic for robustness. 🚀

Free to start

Learn DevOps Bootcamp with an AI tutor — free

Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.

Courses
142
Lessons
568

Frequently Asked Questions

Is the “Install-or-Upgrade with --install” lesson free?

Yes — any 3 lessons of the DevOps Bootcamp learning path, including “Install-or-Upgrade with --install”, are free to read in full here on the web. After that, CoddyKit PRO unlocks every lesson, plus interactive practice with a built-in code editor and a 24/7 AI tutor. The DevOps Bootcamp course includes 4 lessons in total.

What will I learn in “Install-or-Upgrade with --install”?

The idempotent upgrade -i pattern for automation. You practise DevOps Bootcamp with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start DevOps Bootcamp?

No prior experience is required. DevOps Bootcamp on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 2 of 4.

How long does the “Install-or-Upgrade with --install” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this DevOps Bootcamp lesson?

Yes. Every DevOps Bootcamp lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Apply Changes with helm upgrade
  2. Install-or-Upgrade with --install
  3. Reviewing helm history
  4. Reverting with helm rollback
← Back to DevOps Bootcamp