Supergraph podTemplate
Customize the pod templates for your Supergraphs
The .spec.podTemplate
section of your Supergraph resource allows you to customize the underlying Pods and containers.
Properties
additionalContainers
Runs additional containers alongside the main router container. This replicates the Deployment specification for containers.
1spec:
2 podTemplate:
3 additionalContainers:
4 - name: my-container
5 image: my-image:latest
additionalInitContainers
Runs additional init containers. This replicates the Deployment specification for containers.
1spec:
2 podTemplate:
3 additionalInitContainers:
4 - name: my-container
5 image: my-image:latest
affinity
The pod’s scheduling constraints. This replicates the Deployment specification for affinity.
1spec:
2 podTemplate:
3 affinity:
4 requiredDuringSchedulingIgnoredDuringExecution:
5 nodeSelectorTerms:
6 - matchExpressions:
7 - key: topology.kubernetes.io/zone
8 operator: In
9 values:
10 - us-east-1a
11 - us-east-1b
annotations
Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata.
1spec:
2 podTemplate:
3 annotations:
4 sidecar.istio.io/inject: "false"
env
List of environment variables to set in the container. Please note that the Apollo GraphOS Operator will already inject default environment variable values, such as APOLLO_API
or APOLLO_GRAPH_REF
.
1spec:
2 podTemplate:
3 env:
4 - name: APOLLO_ROUTER_LOG
5 value: debug
envFrom
List of ConfigMap or Secret names whose values are to be set in the container as environment variables.
1spec:
2 podTemplate:
3 envFrom:
4 - configMapRef:
5 name: my-config
6 - secretRef:
7 name: my-secret
image
Custom Apollo Router image. Please note that you cannot use image
and routerVersion
at the same time.
1spec:
2 podTemplate:
3 image: my-image:latest
labels
Map of string keys and values that can be used to organize and categorize (scope and select) objects.
1spec:
2 podTemplate:
3 labels:
4 app: my-app
5 tier: backend
podSecurityContext
Holds pod-level security attributes and common container settings.
1spec:
2 podTemplate:
3 podSecurityContext:
4 runAsUser: 1000
5 fsGroup: 2000
priorityClassName
Indicates the pod’s priority.
1spec:
2 podTemplate:
3 priorityClassName: high-priority
resources
Resources is the total amount of CPU and Memory resources required by all containers in the pod.
1spec:
2 podTemplate:
3 resources:
4 requests:
5 cpu: "100m"
6 memory: "128Mi"
7 limits:
8 cpu: "500m"
9 memory: "512Mi"
routerVersion
Apollo Router version. The Apollo GraphOS Operator will automatically use the default Apollo Router image with that version. Please note that you cannot use image
and routerVersion
at the same time.
1spec:
2 podTemplate:
3 routerVersion: 2.4.0
securityContext
Defines the security options the router container should be run with.
1spec:
2 podTemplate:
3 securityContext:
4 runAsNonRoot: true
5 capabilities:
6 drop:
7 - ALL
serviceAccountName
The name of the ServiceAccount to use to run this pod.
1spec:
2 podTemplate:
3 serviceAccountName: my-service-account
terminationGracePeriodSeconds
The duration in seconds that Kubernetes waits before forcefully terminating the pod.
1spec:
2 podTemplate:
3 terminationGracePeriodSeconds: 30
tolerations
The pod’s tolerations.
1spec:
2 podTemplate:
3 tolerations:
4 - key: dedicated
5 operator: Equal
6 value: gpu
7 effect: NoSchedule
topologySpreadConstraints
Describes how a group of pods ought to spread across topology domains.
1spec:
2 podTemplate:
3 topologySpreadConstraints:
4 - maxSkew: 1
5 topologyKey: topology.kubernetes.io/zone
6 whenUnsatisfiable: ScheduleAnyway
7 labelSelector:
8 matchLabels:
9 app: my-app