Passing web.enable-lifecycle flag in container instances YAML file, but prometheus isn't enabling the lifecycle API

Greg 0 Reputation points
2024-07-05T18:39:10.47+00:00

I have a container group running prometheus. I'd like to enable the lifecycle API, which would allow me to reload prometheus' config by hitting an endpoint, but even though I'm passing the flag in my YAML file, the API is not enabled.

Here is my YAML file. I'm using this by running the following command:

az container create --resource-group MY_RESOURCE_GROUP --file MY_YAML_FILE.yml

apiVersion
location
name
type

properties
  
    - 
      
        
        
          - 
          - 
          - 
        
          
            
            
        
          - 
        
          - 
            

  

  
    - 
      
        
        
        
        

  
  
    
    
      - 
        

Prometheus properly boots up with this YAML file, but calling

http://IP_ADDRESS/-/reload

returns Lifecycle API is not enabled

which should be enabled with this command: --web.enable-lifecycle

I believe the issue is in my command array:

command:          
	- /bin/prometheus          
	- --web.enable-lifecycle                    
	- --config.file=/etc/prometheus/prometheus.yml

I have the lifecycle API working properly locally in a docker-compose file, with the following command:

command:
	- 
	- 

I assumed they should be the same, but perhaps the syntax is different in Azure's YAML file.

I also don't fully understand why /bin/prometheus is needed. When using this in my docker-compose file, I only need to pass the flags into the commands array. In azure, prometheus will not boot up without /bin/prometheus (unless the commands array is omitted completely)

Here is a reference to the YAML I'm using: https://learn.microsoft.com/en-us/azure/container-instances/container-instances-reference-yaml

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
710 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.