Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kamal deploy showing health check is failed but its pass when i check it manually. #807

Closed
Tekchanddagar opened this issue May 17, 2024 · 0 comments

Comments

@Tekchanddagar
Copy link

Tekchanddagar commented May 17, 2024

Hello Team,
I am new to Kamal and exploring it right now. I have bought kamal handbook as well.
My Kamal Version: 1.3.0
During kamal deploy somehow healthcheck is failed. Below is my complete config/deploy.yml file:

# Name of your application. Used to uniquely configure containers.
service: sf-app

# Name of the container image.
image: sf-app 
#build: false
# Deploy to these servers.
servers:
  web:
    hosts:
      - 1.2.3.4

# Credentials for your image host.
registry:
  # Specify the registry server, if you're not using Docker Hub
  server: xyz/devops/kamal
  username: _json_key_base64
  password:
    - KAMAL_REGISTRY_PASSWORD
 
builder:
  multiarch: false

# Configure custom arguments for Traefik (commented out)
# traefik:
#   args:
#     accesslog: true
#     accesslog.format: json

# Configure a custom healthcheck (commented out)
healthcheck:
   path: /cloud/health-status
   port: 8080
   max_attempts: 7
   interval: 60s

As per my understanding healthcheck should try 7 times and after every 60 seconds on port 8080 over given health path.

But from the logs its seems it tried 7 times but after every 1 seconds. So my app should be up in 7 seconds and if app doesn't came up in 7 seconds my health check will be failed and its expected. I have checked and my app took more time so i increased interval

But in logs we can see the --health-interval is 60s.

Is i am missing anything here or i am doing it in wrong way?

Please refer the below screenshot for same:

image

But when we create container using docker run command and login into container to check the healt status for the same path its passing. Which confirm my health path is working fine. Please refer the below screenshot for same:

image

Can you please help me to figure out whats mistake i am doing here?

Thank You.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant