Skip to content

Repository files navigation

Artifact Hub

git-hubby Helm Chart

A Helm chart for the git-hubby Kubernetes operator, managing GitHub resources (organizations, repositories, teams, and security configurations) declaratively via Custom Resource Definitions (CRDs).

Overview

This chart deploys the git-hubby controller manager, a Kubernetes operator that reconciles GitHub resources based on custom resources in your cluster. It manages:

  • Organizations — GitHub org settings, Actions permissions, custom properties, code security configurations, and rulesets
  • Repositories — Repository settings, merge strategies, deploy keys, webhooks, autolinks, rulesets, custom properties, and code security
  • Teams — Team membership via IDP group sync or manual member lists, organization roles
  • CodeSecurityConfigurations — GitHub Advanced Security features (code scanning, secret scanning, Dependabot, etc.)
  • RulesetPresets — Reusable branch/tag protection rulesets
  • WebhookPresets — Reusable webhook configurations
  • WebhookIgnorePresets — URL patterns for webhooks to exclude
  • AutolinksPresets — Reusable autolink reference configurations

Prerequisites

  • Kubernetes 1.19+
  • Helm 3+
  • cert-manager installed in the cluster (for webhook and metrics TLS certificates)
  • A GitHub App installation with appropriate permissions

Installation

helm install git-hubby oci://ghcr.io/interhyp/git-hubby-helm/git-hubby \
--version <version> \
-n <namespace> --create-namespace \
-f my-values.yaml

Custom Resource Definitions (CRDs)

CRDs are located in chart/crds/ and are installed automatically. The API group is github.interhyp.de with version v1alpha1.

CRDDescription
OrganizationManages a GitHub organization's settings, Actions config, custom properties, code security, and rulesets
RepositoryManages a GitHub repository's settings, visibility, merge strategies, webhooks, deploy keys, rulesets, and custom properties
TeamManages a GitHub team's membership (IDP sync or manual), organization roles
CodeSecurityConfigurationDefines GitHub Advanced Security feature settings (code scanning, secret scanning, Dependabot, etc.)
RulesetPresetDefines reusable repository/branch rulesets (protection rules, required checks, etc.)
WebhookPresetDefines reusable webhook configurations
WebhookIgnorePresetDefines URL regex patterns to exclude from webhook creation
AutolinksPresetDefines reusable autolink reference configurations

Configuration Parameters

Controller Manager

ParameterDescriptionDefault
controllerManager.replicasNumber of controller manager replicas1
controllerManager.podLabelsAdditional labels for controller manager pods{}
controllerManager.nodeSelectorNode selector for pod scheduling{}
controllerManager.tolerationsTolerations for pod scheduling[]
controllerManager.topologySpreadConstraintsTopology spread constraints for pod distribution (labelSelector auto-injected)soft spread across nodes
controllerManager.podSecurityContext.runAsNonRootRun pods as non-root usertrue
controllerManager.podSecurityContext.seccompProfile.typeSeccomp profile typeRuntimeDefault

Manager Container

ParameterDescriptionDefault
controllerManager.manager.image.repositoryController container image repositoryghcr.io/interhyp/git-hubby
controllerManager.manager.image.tagController container image tag (defaults to chart appVersion if empty)""
controllerManager.manager.argsCommand-line arguments for the managerSee values.yaml
controllerManager.manager.resources.limits.cpuCPU resource limit500m
controllerManager.manager.resources.limits.memoryMemory resource limit128Mi
controllerManager.manager.resources.requests.cpuCPU resource request10m
controllerManager.manager.resources.requests.memoryMemory resource request64Mi
controllerManager.manager.containerSecurityContext.allowPrivilegeEscalationDisallow privilege escalationfalse
controllerManager.manager.containerSecurityContext.capabilities.dropLinux capabilities to drop["ALL"]
controllerManager.manager.containerSecurityContext.readOnlyRootFilesystemMount root filesystem as read-onlytrue

Environment Variables

ParameterDescriptionDefault
envsKey-value map of environment variables injected into the manager container via a ConfigMap{}
VariableDescriptionPossible ValuesDefault
ENABLE_WEBHOOKSEnables or disables Kubernetes admission webhooks for validating Organization and Repository resources on create/update."true", "false""true" (enabled unless explicitly set to "false")
GITHUB_MEMBER_SUFFIXA suffix appended to each team member username before matching/adding them on GitHub. Takes precedence over spec.memberSuffix on the Organization CR. Prefer using spec.memberSuffix for per-organization suffixes in multi-org setups.Any string (e.g. "_company-name", "")"" (no suffix)
REPOSITORY_FINALIZER_MODEControls what happens to a GitHub repository when its Repository CR is deleted from Kubernetes."ignore" (no action), "archive" (archive the repo), "delete" (delete the repo)"ignore"
ENABLE_STARTUP_SPREADINGEnables startup spreading, which distributes reconciliation requests over time after a controller restart to avoid GitHub API rate limit spikes."true", "false""true"
SPREAD_INTERVAL_MINUTESLength (in minutes) of the interval over which delayed reconciliations are randomly distributed. Delayed reconciliations are scheduled between (startup + SpreadPeriod) and (startup + SpreadPeriod + SpreadInterval). This value also serves as the requeue interval after a successful reconciliation.Any positive integer180
STARTUP_SPREAD_PERIOD_MINUTESDuration (in minutes) after pod startup during which unchanged, healthy resources are delayed instead of reconciled immediately. Reconciliations for changed or unhealthy resources are never delayed.Any positive integer5
LOG_LEVELSets the minimum log level. Overrides the --zap-log-level CLI flag. Note:warn is not supported due to limitations of the logr API used by controller-runtime — logr only provides Info (with verbosity levels) and Error; there is no distinct warn level. Use info to see all informational and warning-prefixed messages, or error to suppress them."debug", "info", "error""info"

Service Account

ParameterDescriptionDefault
serviceAccount.createCreate a ServiceAccounttrue
serviceAccount.nameServiceAccount name (defaults to fullname)""
serviceAccount.annotationsAnnotations for the ServiceAccount{}
serviceAccount.secretsSecrets to attach to the ServiceAccount[]
serviceAccount.automountAutomount the ServiceAccount tokentrue

Metrics Service

ParameterDescriptionDefault
metricsService.typeService type for the metrics endpointClusterIP
metricsService.ports[0].namePort namehttps
metricsService.ports[0].portService port8443
metricsService.ports[0].targetPortContainer target port8443
metricsService.ports[0].protocolProtocolTCP

Webhooks

ParameterDescriptionDefault
webhooks.enabledEnable or disable all Kubernetes admission webhook resources (ValidatingWebhookConfiguration, webhook Service, TLS Certificate, Issuer, and NetworkPolicy). Also sets the ENABLE_WEBHOOKS env var on the controller.true
webhookService.typeService type for the webhook endpointClusterIP

TLS Certificates (cert-manager)

The chart manages two cert-manager Certificate resources:

  • Serving certificate — TLS for the webhook endpoint (Secret webhook-server-certificate). Only rendered when webhooks.enabled=true.
  • Metrics certificate — TLS for the metrics endpoint (Secret metrics-server-cert). Always rendered.

Self-signed Issuer

ParameterDescriptionDefault
selfSignedIssuer.enabledCreate a self-signed cert-manager Issuer (named <fullname>-selfsigned-issuer) and use it as the default issuer for both certificates. Set to false when bringing your own issuer.true

When selfSignedIssuer.enabled=true and no explicit issuerRef is configured on a certificate, the chart automatically points that certificate at the built-in self-signed issuer. When selfSignedIssuer.enabled=false, an issuerRefmust be provided for each certificate that is rendered, otherwise the chart will fail with a descriptive error.

Metrics Certificate (metricsCert)

ParameterDescriptionDefault
metricsCert.issuerRefcert-manager issuer reference. Overrides selfSignedIssuer for this certificate.self-signed issuer
metricsCert.issuerRef.kindIssuer kind (Issuer or ClusterIssuer)
metricsCert.issuerRef.nameIssuer name
metricsCert.issuerRef.groupIssuer API group (optional)
metricsCert.durationCertificate validity duration (e.g. 2160h0m0s)cert-manager default
metricsCert.renewBeforeHow long before expiry cert-manager renews the certificate (e.g. 360h0m0s)cert-manager default
metricsCert.privateKey.algorithmPrivate key algorithm (RSA, ECDSA, Ed25519)cert-manager default
metricsCert.privateKey.sizePrivate key size in bitscert-manager default
metricsCert.privateKey.encodingPrivate key encoding (PKCS1, PKCS8)cert-manager default
metricsCert.privateKey.rotationPolicyKey rotation policy (Never, Always)cert-manager default
metricsCert.subjectX.509 subject fields (e.g. organizations, countries)

Serving Certificate (servingCert)

ParameterDescriptionDefault
servingCert.issuerRefcert-manager issuer reference. Overrides selfSignedIssuer for this certificate.self-signed issuer
servingCert.issuerRef.kindIssuer kind (Issuer or ClusterIssuer)
servingCert.issuerRef.nameIssuer name
servingCert.issuerRef.groupIssuer API group (optional)
servingCert.durationCertificate validity duration (e.g. 2160h0m0s)cert-manager default
servingCert.renewBeforeHow long before expiry cert-manager renews the certificate (e.g. 360h0m0s)cert-manager default
servingCert.privateKey.algorithmPrivate key algorithm (RSA, ECDSA, Ed25519)cert-manager default
servingCert.privateKey.sizePrivate key size in bitscert-manager default
servingCert.privateKey.encodingPrivate key encoding (PKCS1, PKCS8)cert-manager default
servingCert.privateKey.rotationPolicyKey rotation policy (Never, Always)cert-manager default
servingCert.subjectX.509 subject fields (e.g. organizations, countries)
servingCert.usagesKey usages (e.g. server auth, client auth)

Example: Bring your own ClusterIssuer

selfSignedIssuer:
enabled: falsemetricsCert:
issuerRef:
kind: ClusterIssuername: letsencrypt-prodduration: 8760h0m0srenewBefore: 720h0m0sservingCert:
issuerRef:
kind: ClusterIssuername: letsencrypt-prod

Other

ParameterDescriptionDefault
kubernetesClusterDomainKubernetes cluster domain suffixcluster.local
nameOverrideOverride the chart name""
fullnameOverrideOverride the full release name""

Testing

This chart uses helm-unittest for unit testing. Tests are located in the tests/ directory.

Running tests locally

# Install the helm-unittest plugin (one-time)
helm plugin install https://github.com/helm-unittest/helm-unittest.git
# Run all tests
helm unittest .

Tests are also executed automatically in CI on every push to main and on pull requests.

Architecture

The chart deploys:

  1. Deployment — The controller manager pod running /manager with webhook and health probe endpoints
  2. Services — A metrics service (port 8443) and a webhook service (port 443 → 9443)
  3. RBAC — ClusterRoles and bindings for the manager, leader election, metrics auth, and per-CRD admin/editor/viewer roles
  4. Certificates — An optional self-signed Issuer (controlled by selfSignedIssuer.enabled), a serving certificate for the webhook endpoint (when webhooks.enabled=true), and a metrics certificate — all via cert-manager. Both certificates fall back to the built-in self-signed issuer unless a custom issuerRef is configured.
  5. ValidatingWebhookConfiguration — Admission webhooks validating Organization and Repository resources on CREATE/UPDATE
  6. NetworkPolicy — Allows webhook traffic from kube-system namespace to the controller on port 9443
  7. ServiceMonitor — Prometheus ServiceMonitor for scraping /metrics from the controller
  8. CRDs — All custom resource definitions in crds/

RBAC Roles

The chart creates the following ClusterRoles for each CRD (organization, repository, team, codesecurityconfiguration, rulesetpreset, webhookpreset, webhookignorepreset, autolinkspreset):

RolePermissions
*-admin-roleFull access (*) to the resource and get on status
*-editor-rolecreate, delete, get, list, patch, update, watch and get on status
*-viewer-roleget, list, watch and get on status

Additionally:

  • *-manager-role — Full operator permissions for all CRDs and secrets
  • *-leader-election-role — ConfigMaps, Leases, and Events for leader election
  • *-metrics-auth-role — TokenReviews and SubjectAccessReviews for metrics authentication
  • *-metrics-reader — Read access to /metrics non-resource URL

About

A Helm chart for deploying the git-hubby Operator.

Topics

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages