Skip to content

Start VM in Harvester #7252

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
Dec 16, 2021
Merged

Start VM in Harvester #7252

merged 2 commits into from
Dec 16, 2021

Conversation

mads-hartmann
Copy link
Contributor

@mads-hartmann mads-hartmann commented Dec 15, 2021

Description

This is the initial step towards providing dedicated VMs for preview environments.

This introduces a new option with-vm for the build Werft job which will start a new VM in our Harvester cluster. This is a tiny step towards providing dedicated k3s clusters for preview environments.

For now it only boots a plain Ubuntu VM, so this is not useable by devs yet as it does not have Kubernetes running inside of it, but it gives us something to iterate on.

Related Issue(s)

Part of https://github.com/gitpod-io/harvester/issues/7

How to test

Run your job with with-vm, e.g

werft run github -f -a with-vm=true

Then in Harvester you should see the VM here.

From Harvester you can get a Serial Console. You can use that to install NGINX

sudo apt-get install nginx

And then you should be able to reach it at http://mads-communicate-with-harvester.preview.gitpod-dev.com/ where mads-communicate-with-harvester is the name of the branch.

The routing is configured in this PR.

Release Notes

NONE

Documentation

N/A

/werft with-vm

@mads-hartmann mads-hartmann self-assigned this Dec 15, 2021
@mads-hartmann mads-hartmann changed the title Mads/communicate with harvester Start VM in Harvester Dec 15, 2021
@mads-hartmann mads-hartmann force-pushed the mads/communicate-with-harvester branch from 40074c7 to 2b2db1a Compare December 15, 2021 13:58
@fullmetalrooster
Copy link
Contributor

We need also a service to access the VM.

apiVersion: v1
kind: Service
metadata:
  name: proxy
  namespace: preview-ubuntu # I followed the scheme of the ingress-proxy where the namespace is always staging-<BRANCH-NAME>
spec:
  ports:
    - name: ssh
      protocol: TCP
      port: 22
      targetPort: 22
    - name: http
      protocol: TCP
      port: 80
      targetPort: 80
    - name: https
      protocol: TCP
      port: 443
      targetPort: 443
    - name: kube-api
      protocol: TCP
      port: 6443
      targetPort: 6443
  selector:
    harvesterhci.io/vmName: ubuntu-01 # This is only an example. It can be any label
  type: ClusterIP

This introduces a new option with-vm for the build Werft job which
will start a new VM in our Harvester cluster.

This is a tiny step towards providing dedicated k3s clusters for
preview environments.

For now it only boots a VM, so this is not useable by devs yet, but
it gives us something to iterate on.

Part of https://github.com/gitpod-io/harvester/issues/7
@mads-hartmann mads-hartmann force-pushed the mads/communicate-with-harvester branch from d3134fb to 832817f Compare December 16, 2021 10:52
@mads-hartmann mads-hartmann marked this pull request as ready for review December 16, 2021 11:05
@mads-hartmann mads-hartmann requested a review from a team December 16, 2021 11:05
@meysholdt
Copy link
Member

/lgtm
/approve

@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: 4518754cf0d271a1881eb921db873744f78b1327

@roboquat
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: meysholdt

Associated issue: #7

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@roboquat roboquat merged commit 4d79bc8 into main Dec 16, 2021
@roboquat roboquat deleted the mads/communicate-with-harvester branch December 16, 2021 13:51
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