Start by using a sharp knife to remove the corn kernels from the cob.
Stand the corn cob upright on a cutting board and run the knife from the top to the bottom, getting as close to the cob as possible.
Put the kernels in a separate bowl.
Slice the yellow onion in half, longways. Remove the papery skin and any straw-like root pieces, but keep the root attached to the onion.
Roughly chop celery.
Add 2 cups of raw corn kernels to a blender and pulse until creamy.
Turn the Instant Pot to sauté and allow it to heat up.
Add a small amount of high-heat oil to the pot and place the half yellow onion face down.
Press down on the onion and let it sear until it becomes lightly charred, about 3 minutes on high heat.
To your Instant Pot or pressure cooker with the onion still in, add corn cobs, blended corn kernels, rosemary sprigs, optional garlic cloves, and chopped celery.
Add 8 cups of water, then add the blended corn kernels and combine as well as you can.
Press CANCEL on the sauté function. Then, close the lid, set the vent to sealing position and pressure cook on HIGH for 20 minutes.
After the 20 minutes are up, perform a natural pressure release for 15 minutes. A natural release means you don't do anything other than press CANCEL, and allow some or all of the pressure to release without touching the valve. I recommend setting a 15 minute timer.
After those 15 minutes, flip the valve to venting and release any remaining pressure.
Then, open the lid.
Use tongs to remove large objects like corn cobs and onion.
Place a large bowl in your kitchen sink, with a fine mesh strainer over the bowl.
Use oven mitts or towels to remove the inner pot from the Instant Pot and pour the contents into the strainer and bowl.
Remove the strainer from the bowl.
Place the strained corn stock in a large air-tight container and store in the fridge.