CLI usage for Seq in Kubernetes #1827
kellybirr
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
Hi Kelly, thanks for sharing that! You may also find init scripts interesting: https://docs.datalust.co/docs/init-scripts These are designed to ease the kind of scenario you're describing. In a nutshell, you place bash scripts into a Once a script has run, Seq will rename it with a marker file extension and will ignore it on subsequent restarts. Hope this helps, |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Earlier today I had to reset auth on a Seq install in AKS where my Azure AD secret for authentication had expired. While I was in there, I also wanted to migrate my metadata to MS-SQL.
If you have Seq deployed via a Kubernetes deployment, you can't use the CLI easily. If use
kubectl exec ...
to get a shell on the container, you can run the CLI but it won't work, because the service is running, and the files are locked. If you kill the service, the container restarts, kicking you out and starting the service back up.The solution is to scale your Seq deployment down to 0 instances, then deploy a Kubernetes Job, using the Seq container, mounting the same persistent volume claim and running the CLI command instead of the container default (the service).
Here are the two YAMLs I used to do this. You may want to incorporate this into your documentation for Kubernetes users.
Migrate to SQL
In the manifest above you will put your actual connection string instead of "<connection-string>". Also you need to use the proper persistent volume claim, mine is "seq-volume-claim".
Reset Auth (metadata in SQL)
Similar to before put in an actual password instead of "<password>" and use the right volume claim name.
Also, this YAML works for non-SQL by removing the SEQ_METASTORE_MSSQL_CONNECTIONSTRING environment variable. To use sql, replace the "<connection-string>" value.
Beta Was this translation helpful? Give feedback.
All reactions