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
routerContainer
Override values in the main router container. This replicates the Kubernetes Container specification but doesn't allow setting name, image, command, args, or workingDir.
1spec:
2 podTemplate:
3 routerContainer:
4 additionalEnv:
5 - name: APOLLO_ROUTER_LOG
6 value: debug
7 additionalVolumeMounts:
8 - name: config-vol
9 mountPath: /etc/configadditionalEnv
List of additional environment variables to set in the router container.
1spec:
2 podTemplate:
3 routerContainer:
4 additionalEnv:
5 - name: APOLLO_ROUTER_LOG
6 value: debugadditionalEnvFrom
List of additional sources to populate environment variables in the router container.
1spec:
2 podTemplate:
3 routerContainer:
4 additionalEnvFrom:
5 - configMapRef:
6 name: router-env-configadditionalVolumes
List of additional volumes that can be mounted by containers belonging to the pod. For more information, see the Kubernetes documentation.
1spec:
2 podTemplate:
3 additionalVolumes:
4 - name: config-vol
5 configMap:
6 name: my-config
7 routerContainer:
8 additionalVolumeMounts:
9 - name: config-vol
10 mountPath: /etc/configimagePullPolicy
Image pull policy. One of Always, Never, IfNotPresent.
1spec:
2 podTemplate:
3 routerContainer:
4 imagePullPolicy: Alwayslifecycle
Actions that the management system should take in response to container lifecycle events. For more information, see the Kubernetes documentation.
1spec:
2 podTemplate:
3 routerContainer:
4 lifecycle:
5 preStop:
6 exec:
7 command: ["/bin/sh", "-c", "sleep 10"]livenessProbe
Periodic probe of container liveness. Container will be restarted if the probe fails. Overrides the default liveness probe. For more information, see the Kubernetes documentation.
1spec:
2 podTemplate:
3 routerContainer:
4 livenessProbe:
5 httpGet:
6 path: /health?live
7 port: 8088
8 initialDelaySeconds: 10
9 periodSeconds: 5additionalPorts
List of additional ports to expose from the router container.
1spec:
2 podTemplate:
3 routerContainer:
4 additionalPorts:
5 - containerPort: 9090
6 name: metrics
7 protocol: TCPreadinessProbe
Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Overrides the default readiness probe. For more information, see the Kubernetes documentation.
1spec:
2 podTemplate:
3 routerContainer:
4 readinessProbe:
5 httpGet:
6 path: /health?ready
7 port: 8088
8 initialDelaySeconds: 5
9 periodSeconds: 10additionalResizePolicies
Resources resize policy for the container.
1spec:
2 podTemplate:
3 routerContainer:
4 additionalResizePolicies:
5 - resourceName: cpu
6 restartPolicy: NotRequiredresources
Compute resources required by the router container.
1spec:
2 podTemplate:
3 routerContainer:
4 resources:
5 requests:
6 cpu: 100m
7 memory: 128Mi
8 limits:
9 cpu: 500m
10 memory: 512MisecurityContext
Security options the router container should be run with.
1spec:
2 podTemplate:
3 routerContainer:
4 securityContext:
5 runAsNonRoot: true
6 readOnlyRootFilesystem: truestartupProbe
Startup probe indicates that the Pod has successfully initialized. For more information, see the Kubernetes documentation.
1spec:
2 podTemplate:
3 routerContainer:
4 startupProbe:
5 httpGet:
6 path: /health?live
7 port: 8088
8 failureThreshold: 30
9 periodSeconds: 10stdin
Whether this container should allocate a buffer for stdin in the container runtime.
1spec:
2 podTemplate:
3 routerContainer:
4 stdin: truestdinOnce
Whether the container runtime should close the stdin channel after it has been opened by a single attach.
1spec:
2 podTemplate:
3 routerContainer:
4 stdinOnce: trueterminationMessagePath
Path to the file containing the container’s termination message.
1spec:
2 podTemplate:
3 routerContainer:
4 terminationMessagePath: /dev/termination-logterminationMessagePolicy
Indicate how the termination message should be populated. File will use the contents of terminationMessagePath.
1spec:
2 podTemplate:
3 routerContainer:
4 terminationMessagePolicy: Filetty
Whether this container should allocate a TTY for itself. Requires stdin to be true.
1spec:
2 podTemplate:
3 routerContainer:
4 tty: true
5 stdin: trueadditionalVolumeDevices
List of block devices to be used by the container.
1spec:
2 podTemplate:
3 routerContainer:
4 additionalVolumeDevices:
5 - name: data
6 devicePath: /dev/xvdaadditionalVolumeMounts
Pod volumes to mount into the router container's filesystem.
1spec:
2 podTemplate:
3 routerContainer:
4 additionalVolumeMounts:
5 - name: config-vol
6 mountPath: /etc/configadditionalContainers
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:latestadditionalInitContainers
Runs additional init containers. This replicates the Deployment specification for containers.
1spec:
2 podTemplate:
3 additionalInitContainers:
4 - name: my-container
5 image: my-image:latestaffinity
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-1bannotations
Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. For more information, see the Kubernetes documentation.
1spec:
2 podTemplate:
3 annotations:
4 sidecar.istio.io/inject: "false"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:latestlabels
Map of string keys and values that can be used to organize and categorize (scope and select) objects. For more information, see the Kubernetes documentation.
1spec:
2 podTemplate:
3 labels:
4 app: my-app
5 tier: backendpodSecurityContext
Holds pod-level security attributes and common container settings.
1spec:
2 podTemplate:
3 podSecurityContext:
4 runAsUser: 1000
5 fsGroup: 2000priorityClassName
Indicates the pod’s priority.
1spec:
2 podTemplate:
3 priorityClassName: high-priorityrouterVersion
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.0serviceAccountName
The name of the ServiceAccount to use to run this pod.
1spec:
2 podTemplate:
3 serviceAccountName: my-service-accountterminationGracePeriodSeconds
The duration in seconds that Kubernetes waits before forcefully terminating the pod.
1spec:
2 podTemplate:
3 terminationGracePeriodSeconds: 30tolerations
The pod’s tolerations.
1spec:
2 podTemplate:
3 tolerations:
4 - key: dedicated
5 operator: Equal
6 value: gpu
7 effect: NoScheduletopologySpreadConstraints
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