Configuring Headers for Images
Scenarios
When images are being pulled, you can add the cci.io/registry-headers annotation to configure the registries and headers and provide more information about the images.
How to Use
When creating a pod, add cci.io/registry-headers: "[{\"registry\":\"swr.cn-north-4.myhuaweicloud.com\",\"headers\":{\"key1\":\"value1\",\"key2\":\"value2\"}},{\"registry\":\"swr.cn-north-8.myhuaweicloud.com\",\"headers\":{\"key1\":\"value1\",\"key2\":\"value2\"}}]" to the annotations field to configure the registries and headers for the container in the pod.
Constraints
- The registries and headers in the cci.io/registry-headers field in the request must be verified.
- The cci.io/registry-headers field in the request is obtained from annotations.
Creating a Pod Using ccictl
You can add an annotation to the workload to control whether to configure the registries and headers for a pod, as shown in the following:
apiVersion: cci/v2
kind: Deployment
metadata:
annotations:
description: ''
labels: {}
name: nginx
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
annotations:
vm.cci.io/pod-size-specs: 2.00_4.0
resource.cci.io/pod-size-specs: 2.00_4.0
metrics.alpha.kubernetes.io/custom-endpoints: '[{api:'''',path:'''',port:'''',names:''''}]'
cci.io/registry-headers: "[{\"registry\":\"{Image repository address}\",\"headers\":{\"key1\":\"value1\",\"key2\":\"value2\"}},{\"registry\":\"{Image repository address}\",\"headers\":{\"key1\":\"value1\",\"key2\":\"value2\"}}]" # Enable the function of configuring registries and headers.
log.stdoutcollection.kubernetes.io: '{"collectionContainers": ["container-0"]}'
labels:
app: nginx
spec:
containers:
- image: library/nginx:stable-alpine-perl
name: container-0
resources:
limits:
cpu: 2000m
memory: 4096Mi
requests:
cpu: 2000m
memory: 4096Mi
command: []
lifecycle: {}
dnsPolicy: ''
imagePullSecrets:
- name: imagepull-secret
dnsConfig: {}
minReadySeconds: 0
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
cci.io/registry-headers indicates that the registries and headers will be configured for the pod.
What is your overall rating for this page?
Thank 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