Skip to content

Add dev/preview:create-preview #13806

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 24, 2022
Merged

Add dev/preview:create-preview #13806

merged 2 commits into from
Oct 24, 2022

Conversation

mads-hartmann
Copy link
Contributor

@mads-hartmann mads-hartmann commented Oct 12, 2022

Description

TODO. Preview environments created in Werft works as expected, but from a workspace I get the following error:

leeway run dev/preview:create-preview
... a lot of output ...
/workspace/gitpod/dev/preview/infrastructure/harvester /workspace/gitpod/dev/preview
harvester_ssh_key.harvester_ssh_key: Creating...
╷
│ Error: Post "https://mads-add-l356b6c92d4.kube.gitpod-dev.com:6443/apis/harvesterhci.io/v1beta1/namespaces/preview-mads-add-l356b6c92d4/keypairs": EOF
│ 
│   with harvester_ssh_key.harvester_ssh_key,
│   on vm.tf line 59, in resource "harvester_ssh_key" "harvester_ssh_key":
│   59: resource "harvester_ssh_key" "harvester_ssh_key" {

Related Issue(s)

Part of https://github.com/gitpod-io/ops/issues/5766
Part of https://github.com/gitpod-io/ops/issues/5892

How to test

leeway run dev/preview:create-preview
leeway run dev/preview:delete-preview

Release Notes

NONE

Documentation

N/A

Werft options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide

@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-mads-add-launch-preview-vm.1 because the annotations in the pull request description changed
(with .werft/ from main)

@vulkoingim
Copy link
Contributor

vulkoingim commented Oct 13, 2022

Error: Post "https://mads-add-l356b6c92d4.kube.gitpod-dev.com:6443/apis/harvesterhci.io/v1beta1/namespaces/preview-mads-add-l356b6c92d4/keypairs": EOF

This looks like the address of the k3s cluster, not of the harvester cluster. I guess what's happening is that the default context in /home/gitpod/.kube/config is set to k3s at some point (when contexts are merged) and since the harvester provider just expects a kubeconfig path - not a context as well, it just uses the default one.

One thing you can do is kubectl config set-context harvester before running, but that doesn't guarantee that the default context won't get changed by some other process at some point. I would recommend having a separate config file just with the harvester context and using that one.

EDIT: Opened harvester/terraform-provider-harvester#55 on the harvester provider and if it gets accepted we'll be able to explicitly pass a context.

@vulkoingim vulkoingim force-pushed the mads/add-launch-preview-vm branch from ad49f4a to 5db6a1d Compare October 24, 2022 11:38
@roboquat roboquat added size/S and removed size/M labels Oct 24, 2022
@vulkoingim vulkoingim marked this pull request as ready for review October 24, 2022 11:53
@vulkoingim vulkoingim requested a review from a team October 24, 2022 11:53
Copy link
Member

@meysholdt meysholdt left a comment

Choose a reason for hiding this comment

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

🚀

mads-hartmann and others added 2 commits October 24, 2022 13:03
Fails with error

│ Error: the server could not find the requested resource (post keypairs.harvesterhci.io)
│
│   with harvester_ssh_key.harvester_ssh_key,
│   on vm.tf line 59, in resource "harvester_ssh_key" "harvester_ssh_key":
│   59: resource "harvester_ssh_key" "harvester_ssh_key" {
@mads-hartmann mads-hartmann force-pushed the mads/add-launch-preview-vm branch from 5db6a1d to 8f02e52 Compare October 24, 2022 13:04
@roboquat roboquat merged commit 36e811e into main Oct 24, 2022
@roboquat roboquat deleted the mads/add-launch-preview-vm branch October 24, 2022 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants