Skip to content

anishbista60/platctl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

platctl

Kubernetes platform installer and GitOps manifest generator. Manages a curated registry of platform tools and can install them via Helm/kubectl or generate Kustomize manifests for GitOps workflows.

Build

go build -o platctl ./cmd/platctl

Binary releases are attached to GitHub Releases (Linux, macOS, Windows — amd64 + arm64).


Commands

install

Installs apps directly into a Kubernetes cluster.

platctl install argocd --config examples/platform.yaml
platctl install cert-manager --version v1.17.2 --config examples/platform.yaml
platctl install argocd --method manifest
platctl install --all --config examples/platform.yaml --dry-run
Flag Description
--config Path to platform.yaml
--all Install all enabled apps
--version Override chart/manifest version
--method Override install method: helm or manifest
--namespace Override target namespace
--set key=value Extra Helm --set overrides (repeatable)
--dry-run Print actions without executing

Version priority (highest → lowest): --version flag → platform.yaml version → registry defaultVersion

Env var fallbacks (used when flag is omitted):

Env var Flag
PLATCTL_VERSION --version
PLATCTL_METHOD --method
PLATCTL_NAMESPACE --namespace
KUBECONFIG --kubeconfig

generate

Generates Kustomize kustomization.yaml files under platform/<app>/{dev,prod}/.

If platform.yaml has an argocd.repoURL, also generates Argo CD Application manifests automatically — no extra flags needed.

platctl generate --all --config examples/platform.yaml
platctl generate argocd kyverno --config examples/platform.yaml
platctl generate --all --config examples/platform.yaml --dry-run
platctl generate --all --output-dir gitops/platform

Output structure:

platform/
├── argocd/
│   ├── dev/kustomization.yaml
│   └── prod/kustomization.yaml
├── cert-manager/
│   ├── dev/kustomization.yaml
│   └── prod/kustomization.yaml
└── argocd-application/          # only when argocd.repoURL is set
    ├── dev/
    │   ├── argocd-app.yaml
    │   └── cert-manager-app.yaml
    ├── prod/
    │   ├── argocd-app.yaml
    │   └── cert-manager-app.yaml
    └── appsofapp/
        ├── dev.yaml              # App-of-Apps watching argocd-application/dev/
        └── prod.yaml             # App-of-Apps watching argocd-application/prod/

Apply only the App-of-Apps to Argo CD — it discovers and syncs all individual Applications automatically.


uninstall

platctl uninstall argocd --config examples/platform.yaml
platctl uninstall --all --config examples/platform.yaml --dry-run

list

platctl list --config examples/platform.yaml
platctl list --enabled-only

Configuration

An example config lives at examples/platform.yaml.

apiVersion: platctl/v1alpha1

# Required for Argo CD Application generation.
argocd:
  repoURL: https://github.com/your-org/platform-repo
  targetRevision: HEAD
  destinationServer: https://kubernetes.default.svc
  project: default
  namespace: argocd
  syncPolicy:
    automated: true
    prune: true
    selfHeal: true

apps:
  argocd:
    enabled: true
    method: helm          # helm | manifest — falls back to registry defaultMethod
    namespace: argocd

  cert-manager:
    enabled: true
    method: helm
    namespace: cert-manager
    version: v1.17.2      # overrides registry defaultVersion
    crds: true            # shorthand for --set crds.enabled=true (helm only)

  argocd-image-updater:
    enabled: true
    method: manifest      # per-app method override

  external-secrets:
    enabled: true
    set:
      installCRDs: "true" # arbitrary helm --set override

Key fields

Field Description
method helm or manifest. Defaults to registry defaultMethod.
version Chart version. Defaults to registry defaultVersion.
namespace Target namespace. Defaults to registry defaultNamespace.
crds Helm only. Shorthand to enable CRD installation via the chart's native flag.
set Arbitrary Helm --set key/value overrides.

App Registry

The embedded registry (internal/registry/registry.yaml) defines all supported apps and their defaults.

App Default Version CRDs Manifest Install
cert-manager v1.17.2 opt-in (crds: true required) yes
argocd 7.8.26 bundled yes
argocd-image-updater 0.11.3 none yes
external-secrets 0.14.4 bundled no
opentelemetry-operator 0.87.0 bundled yes
kyverno 3.3.7 bundled yes
velero 9.0.0 bundled no
cloudnativepg 0.23.2 bundled yes
kubecost 2.6.0 none no
reloader 1.2.0 none yes

All apps default to helm install. Apps marked no in the Manifest Install column only support method: helm — using method: manifest for these apps will return an error. Choose the install method per-app in platform.yaml.


Releasing

Push a vMAJOR.MINOR.PATCH tag to trigger the release workflow:

git tag v0.2.0
git push origin v0.2.0

Development

go test ./...
go build -o platctl ./cmd/platctl
golangci-lint run

About

Deploy and manage your Kubernetes platform stack with a single command

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages