Mounting Standard Output Logs
This section describes how to mount standard output logs to containers 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
The following is an example that 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 containers whose standard output logs are to be 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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot