Mounting Standard Output Logs
This section describes how to mount container standard output logs in a pod to a specified container for easy log retrieval.
Constraints
volume.cci.io/mount-stdlog-containers and volume.cci.io/mount-stdlog-containers-path cannot be configured at the same time.
Using a YAML File
This example shows how to configure this function during workload creation, with the key configuration marked in red:
kind: Deployment
apiVersion: cci/v2
metadata:
name: deploy-example
namespace: namespace-example
spec:
replicas: 1
selector:
matchLabels:
app: deploy-example
template:
metadata:
labels:
app: deploy-example
annotations:
volume.cci.io/mount-stdlog-containers: sidecar #Name of the container where standard output logs are mounted.
spec:
containers:
- name: nginx
image: nginx:latest
resources:
limits:
cpu: '1'
memory: 2Gi
requests:
cpu: '1'
memory: 2Gi
- name: sidecar
image: sidecar:latest
resources:
limits:
cpu: '0'
memory: '0'
requests:
cpu: '0'
memory: '0'
dnsPolicy: Default
imagePullSecrets:
- name: imagepull-secret
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 100%
Annotation |
Type |
Description |
Example Value |
---|---|---|---|
volume.cci.io/mount-stdlog-containers |
String |
|
Example 1: "container-0,container-1" Example 2: "*" |
volume.cci.io/mount-stdlog-containers-path |
String |
|
Example 1: "{\"container-0\":\"/var/log/pods\",\"container-1\":\"/tmp/log/pods\"}" Example 2: "{\"*\":\"/tmp/log/pods\"}" |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.