Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore(examples): update kubernetes devcontainer template with envbuilder provider#14267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
johnstcn merged 3 commits intomainfromcj/examples/devcontainer-kubernetes
Aug 15, 2024

Conversation

johnstcn
Copy link
Member

See also:#14199

Updates the devcontainer-kubernetes template to use the coder/envbuilder provider.
Caching is completely optional here.

@johnstcnjohnstcn self-assigned thisAug 14, 2024
@johnstcnjohnstcnforce-pushed thecj/examples/devcontainer-kubernetes branch from15af3ce to71c8e39CompareAugust 14, 2024 09:57
@@ -222,7 +257,7 @@ resource "kubernetes_deployment" "main" {

container {
name = "dev"
image = local.devcontainer_builder_image
image =var.cache_repo == "" ?local.devcontainer_builder_image : envbuilder_cached_image.cached.0.image
image_pull_policy = "Always"
security_context {}
env {
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

review: leaving as-is untilcoder/terraform-provider-envbuilder#31 is resolved.

There may be some additional Terraform jiggery pokery requried to convertlocal.envbuilder_env into a block list.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

A for-loop would be nice here to set all the envs, wdyt?

Right now it can come fromlocals.envbuilder_env, but eventually fromenvbuilder_cached_image.cached.0.env.

env {for_each=locals.envbuilder_envname=each.keyvalue=each.value}

Not sure iftomap is required (for_each = tomap(locals.envbuilder_env)), probably not?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yeah, but then that needs to be referenced in thekubernetes_pod spec below. I think that may need adynamic{} block?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Possibly, my tf foo is not strong enough 😄

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'll address this in a follow-up. The current way the envbuilder provider outputs the computed env isn't really conducive to this scenario right now anyway.

type = string
}

variable "insecure_cache_repo" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nice solution 👍🏻

@@ -222,7 +257,7 @@ resource "kubernetes_deployment" "main" {

container {
name = "dev"
image = local.devcontainer_builder_image
image =var.cache_repo == "" ?local.devcontainer_builder_image : envbuilder_cached_image.cached.0.image
image_pull_policy = "Always"
security_context {}
env {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

A for-loop would be nice here to set all the envs, wdyt?

Right now it can come fromlocals.envbuilder_env, but eventually fromenvbuilder_cached_image.cached.0.env.

env {for_each=locals.envbuilder_envname=each.keyvalue=each.value}

Not sure iftomap is required (for_each = tomap(locals.envbuilder_env)), probably not?

@johnstcnjohnstcnforce-pushed thecj/examples/devcontainer-kubernetes branch from71c8e39 to821ea40CompareAugust 15, 2024 12:28
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
@johnstcnjohnstcn merged commit91a74f0 intomainAug 15, 2024
24 checks passed
@johnstcnjohnstcn deleted the cj/examples/devcontainer-kubernetes branchAugust 15, 2024 21:08
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 15, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

@dannykoppingdannykoppingAwaiting requested review from dannykopping

Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@johnstcn@mafredri

[8]ページ先頭

©2009-2025 Movatter.jp