Skip to content
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

treewide: revert peerpods node installer #992

Merged
merged 19 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
933caf3
Revert "just: remove cases with ns.yml file"
katexochen Nov 12, 2024
db557a3
Revert "just: ensure peerpod vms are cleaned up on undeploy"
katexochen Nov 12, 2024
85fe4dc
Revert "kuberesource: use our own CAA image"
katexochen Nov 12, 2024
a475b4a
Revert "justfile: push cloud-api-adaptor"
katexochen Nov 12, 2024
0103070
Revert "infra/azure-peerpods: remove unnecessary resources"
katexochen Nov 12, 2024
5d24753
Revert "scripts: remove deploy-caa"
katexochen Nov 12, 2024
ee335a7
Revert "justfile: use node-installer instead of deploy-caa"
katexochen Nov 12, 2024
fde72c2
Revert "infra/azure-peerpods: create k8s resources for configuring CAA"
katexochen Nov 12, 2024
5abaf33
Revert "contrast: add empty reference values for AKS-PEER-SNP"
katexochen Nov 12, 2024
36c6293
Revert "kuberesource: include CAA in node-installer pod on AKS-PEER-SNP"
katexochen Nov 12, 2024
39e8274
Revert "kuberesource: use different containerd path for AKS-PEER-SNP"
katexochen Nov 12, 2024
3ecbce3
Revert "node-installer: support AKS-PEER-SNP when patching containerd…
katexochen Nov 12, 2024
9438bdb
Revert "node-installer: add kata config for AKS-PEER-SNP"
katexochen Nov 12, 2024
22ba580
Revert "genpolicy: use kata genpolicy for AKS-PEER-SNP"
katexochen Nov 12, 2024
da32110
Revert "platforms: add AKS-PEER-SNP"
katexochen Nov 12, 2024
ff4bcfe
scripts: create ~/.kube if it does not exist
burgerdev Nov 13, 2024
10764aa
scripts: support dashes in resource group for upload-image
burgerdev Nov 15, 2024
ade3852
infra: separate IAM from AKS and image
burgerdev Nov 15, 2024
dd18dc4
e2e: smoke test for peer pods
burgerdev Nov 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/e2e_peerpods.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: e2e peer-pods

on:
workflow_dispatch:
inputs:
image-id:
description: "ID of the guest VM image to test (default: build a fresh image)"
required: false
pull_request:
paths:
- .github/workflows/e2e_peerpods.yml
- packages/test-peerpods.sh
- packages/by-name/cloud-api-adaptor/**
- packages/by-name/kata/**
- packages/by-name/image-podvm/**
- packages/nixos

jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ./.github/actions/setup_nix
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
cachixToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Login to Azure
uses: azure/login@a65d910e8af852a8061c627c456678983e180302 # v2.2.0
with:
creds: ${{ secrets.CONTRAST_CI_INFRA_AZURE }}
- name: Test peer-pods
env:
azure_subscription_id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
azure_image_id: ${{ inputs.image-id }}
azure_resource_group: contrast-ci
azure_location: germanywestcentral
CONTRAST_CACHE_DIR: "./workspace.cache"
run: |
ssh-keygen -t rsa -f ./infra/azure-peerpods/id_rsa -N ""
cat >infra/azure-peerpods/iam.auto.tfvars <<EOF
tenant_id = "${{ vars.AZURE_TENANT_ID }}"
client_id = "${{ vars.PEER_POD_CLIENT_ID_AZURE }}"
client_secret = "${{ secrets.PEER_POD_CLIENT_SECRET_AZURE }}"
resource_group = "contrast-ci"
EOF
nix run .#scripts.test-peerpods
- name: Terminate cluster
if: always()
run: |
nix run -L .#terraform -- -chdir=infra/azure-peerpods destroy --auto-approve
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ terraform.tfstate*
id_rsa*
kube.conf
out.env
infra/**/peer-pods-config.yaml
infra/**/kustomization.yaml
uplosi.conf*
2 changes: 1 addition & 1 deletion cli/genpolicy/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func NewConfig(platform platforms.Platform) *Config {
Settings: aksSettings,
Bin: aksGenpolicyBin,
}
case platforms.AKSPeerSNP, platforms.K3sQEMUSNP, platforms.K3sQEMUTDX, platforms.RKE2QEMUTDX:
case platforms.K3sQEMUSNP, platforms.K3sQEMUTDX, platforms.RKE2QEMUTDX:
return &Config{
Rules: kataRules,
Settings: kataSettings,
Expand Down
2 changes: 1 addition & 1 deletion cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func buildVersionString() (string, error) {
switch platform {
case platforms.AKSCloudHypervisorSNP:
fmt.Fprintf(versionsWriter, "\tgenpolicy version:\t%s\n", constants.MicrosoftGenpolicyVersion)
case platforms.AKSPeerSNP, platforms.K3sQEMUSNP, platforms.K3sQEMUTDX, platforms.RKE2QEMUTDX:
case platforms.K3sQEMUSNP, platforms.K3sQEMUTDX, platforms.RKE2QEMUTDX:
fmt.Fprintf(versionsWriter, "\tgenpolicy version:\t%s\n", constants.KataGenpolicyVersion)
}
}
Expand Down
62 changes: 62 additions & 0 deletions infra/azure-peerpods-iam/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 75 additions & 0 deletions infra/azure-peerpods-iam/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "4.5.0"
}
azuread = {
source = "hashicorp/azuread"
version = "3.0.2"
}
local = {
source = "hashicorp/local"
version = "2.5.2"
}
}
}

provider "azurerm" {
subscription_id = var.subscription_id
features {
resource_group {
prevent_deletion_if_contains_resources = false
}
}
}

data "azurerm_subscription" "current" {}

data "azuread_client_config" "current" {}

provider "azuread" {
tenant_id = data.azurerm_subscription.current.tenant_id
}

locals {
name = var.resource_group
}

resource "azurerm_resource_group" "rg" {
name = var.resource_group
location = var.location
}

resource "azuread_application" "app" {
display_name = "${local.name}-app"
owners = [data.azuread_client_config.current.object_id]
}

resource "azuread_service_principal" "sp" {
client_id = azuread_application.app.client_id
app_role_assignment_required = false
owners = [data.azuread_client_config.current.object_id]
}

resource "azurerm_role_assignment" "ra_vm_contributor" {
scope = azurerm_resource_group.rg.id
role_definition_name = "Virtual Machine Contributor"
principal_id = azuread_service_principal.sp.object_id
}

resource "azurerm_role_assignment" "ra_reader" {
scope = azurerm_resource_group.rg.id
role_definition_name = "Reader"
principal_id = azuread_service_principal.sp.object_id
}

resource "azurerm_role_assignment" "ra_network_contributor" {
scope = azurerm_resource_group.rg.id
role_definition_name = "Network Contributor"
principal_id = azuread_service_principal.sp.object_id
}

resource "azuread_application_password" "pw" {
application_id = azuread_application.app.id
}
8 changes: 8 additions & 0 deletions infra/azure-peerpods-iam/outs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
output "client_secret_env" {
value = <<EOF
client_id = "${azuread_application.app.client_id}"
tenant_id = "${data.azurerm_subscription.current.tenant_id}"
client_secret = "${azuread_application_password.pw.value}"
EOF
sensitive = true
}
11 changes: 11 additions & 0 deletions infra/azure-peerpods-iam/vars.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
variable "resource_group" {
type = string
}

variable "location" {
type = string
}

variable "subscription_id" {
type = string
}
30 changes: 0 additions & 30 deletions infra/azure-peerpods/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading