Skip to main content

Command Palette

Search for a command to run...

gascity and kubernetes?

Updated
4 min read
gascity and kubernetes?

I was introduced to gastown earlier this year via someone sending me a post on medium. yegge is an engaging writer/persona and like many people I was interested in the idea. but not in a "work on it" way more in a "this provokes thought while in the bathroom" kind of way.

before I could even blink (such is the speed of ai these days) it was already deprecated in favor of the new hotness gascity, announced with yet another engaging post on medium. and this time I have been contemplating a move away from idle bathroom consideration to actual involvement.

the main thing I like to do with any shiny new toy is play around with it and also see how it fits in with things I already know or at least kind of understand. so I had an idea of where I wanted to go with gascity.

the install is pretty straightforward on a mac, especially when you throw homebrew into the mix, but I kind of want more isolation for these sorts of experiments. I was pleasantly surprised to see that there were the beginnings of something I could use in kubernetes in the contrib/k8s folder in the project. this is amusing in that gastown/gascity is a kubernetes like abstraction for ai agents. I'm here for it. queue the "yo dawg, I heard you like" memes.

I decided to do the sort of thing I know how to do (and that I've already blogged about once here) and build an end-to-end test suite. I lightly modified the existing manifests and container definitions in the repo to automate launching gascity in kubernetes using Task, helm, and kind. the pr is there for anyone to review, test, and use.

to get everything running all you have to do is a) meet the prerequisites (the Taskfile.yml already has check:tools for this but the requirements are that you have helm, kubectl, and task installed locally via method of your choosing), and ii) run task up. that's it. running task with no arguments shows you the full list of tasks, which looks like the following:

when task up has completed you'll be able to query helm and use kubectl like you would with any other helm install and kubernetes cluster.

when you're done tear it all down with task down and the gas-city kind cluster gets wiped away along with all of its gascity contents.

but what if you wanted more? you seem like the ambitious sort, I get that. same (occasionally). wouldn't it be cool if you could get the whole hello world demo with this setup? I thought it would be anyway, so I added that too. if you run task demo you get some additional things thrown with reckless abandon onto your kind cluster. I should note that I'm running docker with 4 of my 6 vcpus and 6 of the 8 gb of ram my poor macbook neo has. it might literally be crying when I do this.

the first difference is you get a gc-opencode-agent container and the gc-controller image is built on top of that layer. the helm chart installs with ollama.enabled=true, controller.inCluster=true, and agent.image.repository=gc-opencode-agent. an ollama pod gas-city-ollama-XXXXXX-YYY will pull model codegemma:2b and gascity will use that instead of requiring an api key with a commercial llm. when task demo is complete you'll get some instructions about what to do next. the steps are all encoded as tasks so you can run them that way pretty easily.

you sling the predefined "Create a Python script called hello.py that prints hello world" task to the coder agent via task demo:sling.

that will output some information that you can use if you want to watch the bead (not required but informative).

you can also optionally open the gascity dashboard using two terminals, one to start a port forward via task demo:port-forward and one to fire off a browser via task demo:dashboard. if you're not on a mac use one terminal to start the port forward and open up http://localhost:7373 using your browser of choice. this is again not a required step but valuable for learning the system and what it makes available to you.

when everything completes you can exec into the controller to see the results, a fancy new hello world script written in python.

if that all seems fun or interesting to you go check out the pr, make a comment, or add some stuff onto it with your own fork/pr. happy hacking, as the saying goes.