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

The Vault pod is not ready after I restart my computer #326

Closed
nhaancs opened this issue Oct 30, 2023 · 13 comments
Closed

The Vault pod is not ready after I restart my computer #326

nhaancs opened this issue Oct 30, 2023 · 13 comments

Comments

@nhaancs
Copy link
Contributor

nhaancs commented Oct 30, 2023

Why does the Vault pod keep becoming not ready every time I restart my computer? To fix this, I have to delete the cluster and start it again. Thanks.
Screenshot 2023-10-30 at 21 44 35

@ardan-bkennedy
Copy link
Contributor

Vault is very complicated. You have to start Vault, but it won't work until it's unsealed and inititalized. We decided to have the Sales-Api service do this in the initContainer. So, until the initContainer runs, Vault is useless. I believe we are using cluster level persisted storage for what we need to do to init the system and I would have expected that to help in the situation you are experiencing.

Beyond this information, I'm not sure.

@nhaancs
Copy link
Contributor Author

nhaancs commented Oct 30, 2023

Thanks. Are you experiencing the same situation? I'm not sure if this is a known issue of the project, or if have I done something wrong with my code.

@ardan-bkennedy
Copy link
Contributor

I will run the project again shortly. Maybe I broke something in the past 24 hours.

@ardan-bkennedy
Copy link
Contributor

The code is working. I did push changes if you want to run the latest.

@nhaancs
Copy link
Contributor Author

nhaancs commented Oct 31, 2023

Hi @ardan-bkennedy,

I pulled your latest code and started the cluster, everything was ok. But after I restarted my Docker Desktop, the dev-status command resulted as below:
Screenshot 2023-10-31 at 10 33 24

@ardan-bkennedy
Copy link
Contributor

Having sleeping on it I think the problem might be the order docker is restarting the containers. It's critical that vault is started before sales and there is time between the two. I made some changes to the apply to test things out. I just start the observability services without waiting first, then I start the vault, database, wait, sales.

I always bring down the cluster every night, but even when I just put my machine to sleep I don't have issues. I am curious why you are restarting docker?

@ardan-bkennedy
Copy link
Contributor

ardan-bkennedy commented Oct 31, 2023

Having slept on it I think the problem might be the order docker is restarting the containers. It's critical that vault is started before sales and there is time between the two. I made some changes to the apply to test things out. I just start the observability services without waiting first, then I start the vault, database, wait, sales.

I always bring down the cluster every night, but even when I just put my machine to sleep I don't have issues. I am curious why you are restarting docker?

@ardan-bkennedy
Copy link
Contributor

Having sleeping on it I think the problem might be the order docker is restarting the containers. It's critical that vault is started before sales and there is time between the two. I made some changes to the apply to test things out. I just start the observability services without waiting first, then I start the vault, database, wait, sales.

I always bring down the cluster every night, but even when I just put my machine to sleep I don't have issues. I am curious why you are restarting docker?

@nhaancs
Copy link
Contributor Author

nhaancs commented Oct 31, 2023

I don't think putting the machine to sleep will cause the issue. I only ran into this situation when I shut down my computer and then started it again to continue my work. In other words, this issue happens as my Docker gets restarted.
I clone the repository and develop my own project. So I don't want to start and delete the cluster too often because it takes time and I don't want old data in the database being reset.

@ardan-bkennedy
Copy link
Contributor

Look at the changes to apply, this has sped up the time it takes to bring up the cluster.

I NEVER shut my machine down. Have you tried just putting your machine to sleep instead of shutting it down all the time?

I have a solution for the DB. You can run the database outside the cluster and keep the volume around.

Read the dev-database-external.yaml file.

@nhaancs
Copy link
Contributor Author

nhaancs commented Oct 31, 2023

Yes, I think an external database will work. Just wonder if is there anything that we can do with Vault instead.

@ardan-bkennedy
Copy link
Contributor

You don't need value. Use my in-memory keystore.

@nhaancs
Copy link
Contributor Author

nhaancs commented Nov 1, 2023

Yes,thanks

@nhaancs nhaancs closed this as completed Nov 1, 2023
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

2 participants