Here is the minimal reproducible sample
configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-conf
data:
default: |
server {
server_name myserver.com;
location /read/ {
proxy_pass https://myaccount.blob.core.windows.net/mycontainer/file.txt;
}
}
In my deployment file, I am mounting the configmap as volume as:
containers:
- name: nginx
image: nginx
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
name: http
volumeMounts:
- name: nginx-config
mountPath: /etc/nginx/site-enabled/default
subPath: default
volumes:
- name: nginx-config
configMap:
name: nginx-config
After deployment an API call looks:
curl https://myserver.com/read
as a response to getting
{"error":"Not found","status":404}
The azure blob data ist accessible for reading. A pure API call via curl on https://myaccount.blob.core.windows.net/mycontainer/file.txt;
is successfully done.