GitHub Service
Build and deploy Services from GitHub repositories with Docker.
The github Service type builds and deploys applications from a GitHub
repository with a Dockerfile. Use this Service type for application code that
Lifecycle must build from source.
Examples
Minimal configuration with only required fields:
Docker configuration
The docker section defines how Lifecycle builds and runs the application.
docker.defaultTag
The default Docker image tag, typically matching the branch name.
docker.builder
Configuration for the Docker build operation.
| Field | Type | Description |
|---|---|---|
engine | string | Build engine: buildkit, kaniko, or ci |
resources.requests | object | Minimum CPU/memory guaranteed for the build job |
resources.limits | object | Maximum CPU/memory allowed for the build job |
podAnnotations | Record<string,string> | Custom annotations applied to the build pod template |
The resources field configures CPU and memory for the build Job container.
Use standard Kubernetes resource units. For example, use "500m" for CPU and
"1Gi" for memory.
Service resource values replace the installation defaults. If you need a
specific build engine, set engine explicitly. For engine: ci, also set
docker.pipelineId to the Codefresh image-build pipeline.
Each build pod automatically has the annotation
cluster-autoscaler.kubernetes.io/safe-to-evict: "false" to prevent the
Kubernetes cluster autoscaler from evicting long-running build jobs during
scale-down. The podAnnotations field adds Service annotations. It cannot
override the safe-to-evict value.
| Engine | Default CPU request | Default memory request | Default CPU limit | Default memory limit |
|---|---|---|---|---|
| buildkit | 500m | 1Gi | 2 | 4Gi |
| kaniko | 300m | 750Mi | 1 | 2Gi |
docker.app (required)
Configuration for the main application container:
dockerfilePath- Required. Path to Dockerfile relative to repo rootcommand- Override container entrypointarguments- Arguments passed to the command. Use%%SPLIT%%to delimit spaces, for example,-c%%SPLIT%%npm run start.env- Environment variablesports- Exposed container ports
Optional Docker-level fields:
| Field | Description |
|---|---|
pipelineId | Codefresh image-build pipeline used by engine: ci |
ecr | Registry identifier override used for the built image |
docker.app.afterBuildPipelineConfig can configure a follow-up Codefresh
pipeline:
| Field | Description |
|---|---|
afterBuildPipelineId | Pipeline to run after an image build succeeds |
description | Human-readable pipeline description |
detatchAfterBuildPipeline | Legacy misspelled compatibility field |
detatchAfterBuildPipeline is the accepted spelling. Use it only with an
existing configuration that needs this behavior. Do not add it to a new
configuration.
docker.init (optional)
Configuration for an init container that runs before the primary application
container. The init container has the fields from docker.app.
Deployment options
The deployment section configures how Lifecycle deploys the Service to
Kubernetes. All fields are optional.
public
The public field controls ingress exposure.
true- Lifecycle creates an ingress and a public URL.false- Users can access the Service only in the cluster.
capacityType
Specifies the node capacity type for scheduling:
SPOT- Prefer spot instances. This is the default.ON_DEMAND- Use only on-demand instances.
SPOT adds a preferred spot-node affinity. Kubernetes can select on-demand
capacity when spot capacity is unavailable. ON_DEMAND adds a mandatory
on-demand affinity.
Use SPOT or ON_DEMAND. Other spellings can prevent workload scheduling.
resource
CPU and memory requests and limits for the container:
| Field | Description |
|---|---|
cpu.request | Minimum CPU guaranteed, for example, 100m |
cpu.limit | Maximum CPU allowed, for example, 1000m |
memory.request | Minimum memory guaranteed, for example, 256Mi |
memory.limit | Maximum memory allowed, for example, 1Gi |
readiness
A health check tells Lifecycle when the Service is ready to receive traffic.
HTTP health check:
| Field | Description |
|---|---|
httpGet.path | HTTP endpoint path, for example, /health |
httpGet.port | Port to check |
TCP health check:
| Field | Description |
|---|---|
disabled | Disable the generated readiness probe |
tcpSocketPort | TCP port to check connectivity |
Shared fields:
| Field | Description |
|---|---|
initialDelaySeconds | Delay before first check |
periodSeconds | Interval between checks |
timeoutSeconds | Timeout for each check |
successThreshold | Consecutive successes to be healthy |
failureThreshold | Consecutive failures to be unhealthy |
hostnames
Custom hostname configuration. If hostnames is missing, Lifecycle generates
the hostnames.
| Field | Description |
|---|---|
host | Custom hostname suffix |
defaultInternalHostname | Internal Kubernetes hostname |
defaultPublicUrl | Default public URL |
acmARN | AWS ACM certificate ARN for TLS |
network
Advanced network configuration:
| Field | Description |
|---|---|
ipWhitelist | Array of allowed IP ranges (CIDR notation) |
pathPortMapping | Map URL paths to container ports |
hostPortMapping | Map hostnames to container ports |
grpc.enable | Enable gRPC support |
grpc.host | gRPC hostname |
grpc.defaultHost | Default gRPC hostname fallback |
serviceDisks
Persistent volume mounts for stateful data:
| Field | Required | Description |
|---|---|---|
name | Yes | Volume name |
mountPath | Yes | Container path |
storageSize | Yes | Storage size, for example, 10Gi |
accessModes | No | ReadWriteOnce, ReadOnlyMany, ReadWriteMany, or ReadWriteOncePod |
medium | No | Storage medium |
Node placement
Use deployment.node_selector for simple Kubernetes node-label matches and
deployment.node_affinity for a full Kubernetes nodeAffinity object.
Custom node affinity replaces Lifecycle’s capacity-type affinity.
Field reference
Required fields
| Field | Type | Description |
|---|---|---|
repository | string | GitHub repository in owner/repo format |
branchName | string | Branch to build from |
docker | object | Docker build configuration (see above) |
Optional fields
| Field | Type | Description |
|---|---|---|
deployment | object | Deployment configuration (see above) |
envLens | boolean | Enable the Environment Lens ingress banner |
Template variables
Use template variables to reference other Services in your configuration. See Template variables for the full list.