Skip to content

Latest commit

 

History

History
102 lines (74 loc) · 1.74 KB

File metadata and controls

102 lines (74 loc) · 1.74 KB

Service Helm Library

Description

This chart is a Helm library chart that provides a reusable Kubernetes Service template. It follows Kubernetes best practices and is designed to be generic, flexible, and safe by default.

The library does not deploy resources by itself. It must be consumed by an application chart using include.

The goal is to standardize Service definitions across applications while keeping full configurability.

Usage

Include

# Append this in application Chart.yaml
dependencies:
  - name: service
    version: 0.1.0
    repository: oci://ghcr.io/qirelo

Then include the Service template in your application chart:

{{ include "service.service" . }}

List of fields

Main supported values (non-exhaustive)

service:
  type: string                # ClusterIP | NodePort | LoadBalancer | ExternalName
  clusterIP: string
  headless: bool

  externalName: string        # Required when type=ExternalName

  labels: {}
  annotations: {}

  selector: {}                # Defaults to app.kubernetes.io/name: <release>

  ports:
    - name: string
      port: int               # Required
      targetPort: int|string
      protocol: TCP|UDP
      nodePort: int

Examples

Minimal Service

service:
  ports:
    - port: 80

HTTP Service

service:
  type: ClusterIP
  ports:
    - name: http
      port: 80
      targetPort: 8080

NodePort Service

service:
  type: NodePort
  ports:
    - port: 80
      targetPort: 8080
      nodePort: 30080

ExternalName Service

service:
  type: ExternalName
  externalName: db.example.com