Skip to content

Replace YAML ConfigMap with Pulumi code in GitOps blog post#17633

Merged
dirien merged 1 commit intomasterfrom
claude/vibrant-gould
Feb 27, 2026
Merged

Replace YAML ConfigMap with Pulumi code in GitOps blog post#17633
dirien merged 1 commit intomasterfrom
claude/vibrant-gould

Conversation

@dirien
Copy link
Copy Markdown
Contributor

@dirien dirien commented Feb 21, 2026

Summary

  • Replaced the static YAML ConfigMap example in the "GitOps Best Practices" blog post (section 11: Bridge your IaC and GitOps) with real Pulumi code
  • Added TypeScript and Python versions using chooser/choosable Hugo shortcodes for language tabs
  • The code uses @pulumi/kubernetes (TypeScript) and pulumi_kubernetes (Python) to create the same cluster-metadata ConfigMap in the argocd namespace

Test plan

  • make lint passes with no new errors
  • make serve renders the page correctly
  • Language tabs switch between TypeScript and Python
  • Code syntax highlighting works for both languages

The gitops-bridge example in the blog post was a raw YAML ConfigMap.
Replace it with real Pulumi code in TypeScript and Python using the
chooser/choosable shortcodes for language tabs.
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Feb 21, 2026

Documentation Review

The changes look good overall. Replacing the static YAML with real Pulumi code is a meaningful improvement for a Pulumi blog post — it demonstrates actual SDK usage rather than the Kubernetes resource output.

Issues

Python: inconsistent use of ConfigMapArgs

The Python example uses k8s.meta.v1.ObjectMetaArgs for the metadata field but passes data as a plain dict. For consistency, both could use explicit Args types or both use plain dicts. The mixed style may confuse readers new to the SDK. Plain dict for data is valid (it's a Mapping[str, str]), but the asymmetry is worth noting.

TypeScript: unquoted data keys vs Python quoted keys

In the TypeScript example, the data properties are unquoted identifiers (aws_account_id, cluster_name, etc.), while in Python they're quoted strings ("aws_account_id", etc.). Both are correct, but the visual inconsistency across tabs may confuse readers comparing the two versions. Consider quoting the TypeScript keys for symmetry:

    data: {
        "aws_account_id": "123456789012",
        "cluster_name": "prod-us-east-1",
        "iam_role_arn": "arn:aws:iam::123456789012:role/app-role",
        "oidc_provider": "oidc.eks.us-east-1.amazonaws.com/id/EXAMPLE",
    },

This is a minor style note, not a correctness issue.

Duplicate resource name and metadata.name

Both examples pass "cluster-metadata" as the Pulumi resource name (first positional argument) and again as metadata.name. This is correct and intentional, but readers unfamiliar with Pulumi might wonder why the name appears twice. A brief inline comment or a sentence in the surrounding prose explaining that the first argument is Pulumi's logical name (used for state tracking) while metadata.name is the Kubernetes resource name would help.

Correctness

The k8s.core.v1.ConfigMap constructor and field structure look correct for both TypeScript and Python. The k8s.meta.v1.ObjectMetaArgs import path in Python is accurate. The chooser/choosable shortcode syntax matches Pulumi's Hugo conventions.


If you'd like me to take another look after any changes, mention @claude in a comment.

@pulumi-bot
Copy link
Copy Markdown
Collaborator

```typescript
import * as k8s from "@pulumi/kubernetes";

const clusterMetadata = new k8s.core.v1.ConfigMap("cluster-metadata", {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This declares the ConfigMap, but where does the serialization of it happen? Is there an export or a .write() method or something somewhere that should show this (and ideally also show the serialized YAML as before)?

Copy link
Copy Markdown
Contributor

@CamSoper CamSoper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvement — replacing the static YAML with real Pulumi TypeScript and Python code makes this section much more instructive for readers. The shortcode structure and API usage look correct. Thanks, @dirien!

@dirien dirien merged commit 8e3f7a8 into master Feb 27, 2026
17 checks passed
@dirien dirien deleted the claude/vibrant-gould branch February 27, 2026 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants