How to push templates to Kubernetes Coder from GitLab CI/CD?
Hi all,
I am trying to push my Terraform templates to my self-hosted Coder running in Kuberentes. I followed this guide: https://coder.com/docs/admin/templates/managing-templates/change-management#coder-cli
This is the error I am getting:
I am using this command:
I appreciate this may be more of a GitLab than Coder question, but I was wondering whether someone else has accomplished something similar?
To allow GitLab to connect to my Kuberentes cluster, I set up an agent in my Kubernetes cluster: https://docs.gitlab.com/ee/user/clusters/agent/install/index.html
Could anyone point me in the wrong direction? Any help would be much appreciated!
Change Management - Coder Docs
Learn about template change management and versioning
9 Replies
<#1293964911877160970>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Sorry, it looks like my description disappeared. Retyping...
Hi all,
We are running Coder self-hosted in our Kubernetes cluster.
I would like to push templates from GitLab CI/CD to Coder: https://coder.com/docs/admin/templates/managing-templates/change-management#coder-cli. I followed this approach using the Coder CLI where I am using an API token.
This is the error message I'm seeing:
I set up my GitLab (using gitlab.com, not self-hosted) to talk to Kubernetes via an agent I installed in my cluster (following these instructions: https://docs.gitlab.com/ee/user/clusters/agent/install/index.html)
Has anyone else tried to accomplish the same thing? If so, any pointers would be much appreciated!
Looks like a bug with Coder CLI.
Could you try to get your org name or uuid for the default org with
https://${CODER_URL}/api/v2/organizations
and then
Can you try coder templates push --yes ${TEMPLATE_NAME} --directory ${TEMPLATE_DIR} --org ${ORG_UUID} or ${ORG_NAME}
Thanks, Atif.
Could you try to get your org name or uuid for the default org with https://${CODER_URL}/api/v2/organizationsI have tried this: But I don't get back a 405. It looks like it's expecting
POST
instead of GET
I am looking at this endpoint section in your API reference: https://coder.com/docs/reference/api/organizations#code-samples-2@Karan you can directly append this to your URL in browser and will get a json response.
@Atif , I get a 405 in my browser also:
What about
https://coder.example.com/api/v2/organizations/default
?@Atif , that URL doesn't work for me:
YOu need to replace the coder.example.com with your coder deployment URL