Creating a multi-chart cluster image

Hey Everyone,

I’m having a little bit of trouble figuring out how to create custom images of my K8s cluster. I have an Azure cluster up and running with some demo apps installed for test purposes: a notes web-api app made with Swagger (written in C#) using MongoDB. The apps themselves aren’t that important, but I’m trying to understand the process of creating an image of this cluster I have setup.

A little background info. I’ve already gone through the quick start guide and gotten everything up and running and I’m now trying to follow the guide here. I do the following:

  • Create an image manifest file with kind: Bundle
  • Create an install.yaml that points to an that installs both helm charts
  • Create helm charts for both my apps on the cluster by using helm create APP_NAME

I can create the tarball but when I install the job always hits the backoff limit when it has to install my applications to the cluster. My C# app is in a docker image that is fetched from its repository.

I’m not sure what I should be doing to create this image of my working cluster. Should I be modifying the helm charts that helm create give me? Am I missing some vital steps or something? Any help is much appreciated.

@CBrucePerkins In this case I think it’s important to understand why the install job (the script) is crashing. Based on your description, it could be something as simple as a typo that’s just preventing the install hook (the job you define in install.yaml) from completing.

To debug the hook, there are a couple options:

  1. When the hook does finally fail, logs for the hook should be available in the install log (/var/log/gravity-install.log and /var/log/gravity-system.log).
  2. At the point the cluster is running hooks, you actually have a fully functional cluster. So it’s often easiest to just take a look at the pod and see why it’s crashing and what errors are present. IIRC the hook job will respect the name and namespace in the job definition, and if unset will be something like kube-system/install-. So a quick kubectl -n kube-system get po to see what the status of the running pods is, and then kubectl -n kube-system describe po <po> and kubectl -n kube-system logs <po> to see what’s going on with the install hook.

The hooks are just sort of special kubernetes jobs that run at certain stages in the application lifecycle. So seeing why the job fails might give an indication of what needs to be tweaked in the charts or install script.

Thanks for the tip. I was able to go through the logs and see that it wasn’t finding an install hook for some reason. I looked through the script and saw that it was using a -c command which was throwing something off in my OS (Centos 7). After removing the -c from the install.yaml command the install now completes successfully. The problem now is that my app isn’t working the way it should, but that is almost certainly a problem with my app.

I’ll have to play around with it a little more to understand why it isn’t behaving the way it should.