Error: Reading Az Context file "/etc/appgw/azure.json" failed: open /etc/appgw/azure.json: permission denied

Anjali Singh 1 Reputation point
2020-10-13T16:39:50.58+00:00

Error: Reading Az Context file "/etc/appgw/azure.json" failed: open /etc/appgw/azure.json: permission denied

I am getting an error related to this, Please help to identify the issue

Name:         ingress-azure-1601834933-77f4978499-jzsr5
Namespace:    default
Priority:     0
Node:         aks-agentpool-26714526-vmss000002/10.240.0.226
Start Time:   Fri, 09 Oct 2020 14:50:44 +0530
Labels:       aadpodidbinding=ingress-azure-1601834933
              app=ingress-azure
              pod-template-hash=77f4978499
              release=ingress-azure-1601834933
Annotations:  checksum/config: cfd91a5a7795ab06d41d6b5e7df20965936069437759bdf4e18323fc52894138
              prometheus.io/port: 8123
              prometheus.io/scrape: true
Status:       Running
IP:           10.240.1.2
IPs:
  IP:           10.240.1.2
Controlled By:  ReplicaSet/ingress-azure-1601834933-77f4978499
Containers:
  ingress-azure:
    Container ID:   docker://c93ed14bdeb798b6ff9e0e1feaafd9f23afba19b3dd31391c4635dbf69e2d2e6
    Image:          mcr.microsoft.com/azure-application-gateway/kubernetes-ingress:1.2.1
    Image ID:       docker-pullable://mcr.microsoft.com/azure-application-gateway/kubernetes-ingress@sha256:cf1df9645ded72127967c99bbf88b758b5b19b698ba18a9ed74c3a7ebf016ef1
    Port:           <none>
    Host Port:      <none>
    State:          Running
      Started:      Fri, 09 Oct 2020 16:22:59 +0530
    Last State:     Terminated
      Reason:       Error
      Exit Code:    255
      Started:      Fri, 09 Oct 2020 16:12:45 +0530
      Finished:     Fri, 09 Oct 2020 16:22:57 +0530
    Ready:          False
    Restart Count:  9
    Liveness:       http-get http://:8123/health/alive delay=15s timeout=1s period=20s #success=1 #failure=3
    Readiness:      http-get http://:8123/health/ready delay=5s timeout=1s period=10s #success=1 #failure=3
    Environment Variables from:
      ingress-azure-1601834933  ConfigMap  Optional: false
    Environment:
      AZURE_CLOUD_PROVIDER_LOCATION:  /etc/appgw/azure.json
      AGIC_POD_NAME:                  ingress-azure-1601834933-77f4978499-jzsr5 (v1:metadata.name)
      AGIC_POD_NAMESPACE:             default (v1:metadata.namespace)
    Mounts:
      /etc/appgw/azure.json from azure (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from ingress-azure-1601834933-token-j26h8 (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  azure:
    Type:          HostPath (bare host directory volume)
    Path:          /etc/kubernetes/azure.json
    HostPathType:  File
  ingress-azure-1601834933-token-j26h8:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  ingress-azure-1601834933-token-j26h8
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                 node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason     Age                    From     Message
  ----     ------     ----                   ----     -------
  Warning  Unhealthy  2m49s (x563 over 97m)  kubelet  Readiness probe failed: Get http://10.240.1.2:8123/health/ready: net/http: request canceled (Client.Timeout exceeded while awaiting headers)




-------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------



ERROR: logging before flag.Parse: I1009 10:22:18.658900       1 utils.go:115] Using verbosity level 3 from environment variable APPGW_VERBOSITY_LEVEL
ERROR: logging before flag.Parse: I1009 10:22:18.658983       1 main.go:78] Unable to load cloud provider config '/etc/appgw/azure.json'. Error: Reading Az Context file "/etc/appgw/azure.json" failed: open /etc/appgw/azure.json: permission denied
I1009 10:22:18.691424       1 environment.go:240] KUBERNETES_WATCHNAMESPACE is not set. Watching all available namespaces.
I1009 10:22:18.691567       1 main.go:128] Appication Gateway Details: Subscription="17dbc3e5-9c62-4898-80e8-47d8ac77d641" Resource Group="dev-cluster" Name="test-app-gateway"
I1009 10:22:18.691581       1 auth.go:46] Creating authorizer from Azure Managed Service Identity
I1009 10:22:18.691643       1 httpserver.go:57] Starting API Server on :8123
Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
1,089 questions
Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,187 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.