For the first week out of port it is delicious. The cooks know their stuff.

To save space, bread is made fresh every day. I love fresh bread, especially with real butter!

We would get a good loadout of eggs, fruit, vegetables, and meat. And ice cream, of course.
The crew is always operating, so four meals a day are served. The midnight meal is known as midrats, and is usually a combination of leftovers and something cooked special for the meal.
Then, after a week, the fresh food was usually gone. At breakfast, the eggs would be scrambled powdered eggs, although sometimes there would still be some real eggs, but you could tell they were old.

After a few more weeks, there were no more real potatoes, no more real vegetables, and everything was from a can.
When loading out for a long deployment, the floor of the main deck had a bunch of food cans, with a flat surface on it. Bigger boats had rooms and stuff for their cans.

The potatoes were canned, peeled ovoids commonly known as snake eggs.

Potatoes

Snake Eggs
Salads degenerated to three bean salads, usually green beans, garbanzo beans, and some other random bean, in an oil and vinegar base.

After seven weeks, it was slim pickings. We were scraping the bottom of the barrel. There was a lot of dense pasta from a can, like ravioli. All the meat that wasn’t from a can had freezer burn. Dessert was still served, but it was jello.

We never made it past 67 days away from port, so I don’t know what happens after that.
But coffee – now that was essential. A lot of submariners drink their coffee black. I didn’t used to, but cream always turned bad at some point. Even if it was fresh, it was left out. And powdered creamer is nasty. On submarines is where I learned to like my coffee black.

We never ran out of coffee.