-
Notifications
You must be signed in to change notification settings - Fork 342
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
[FEATURE] terraform-provider-rancher2 to support to add additional NIC and disks #2733
Comments
Pre Ready-For-Testing Checklist
|
new version of terraform-provider-rancher2 not released yet. |
Verified this feature has been implemented. Test Information
Verify Steps
Additional Contextref to rancher/terraform-provider-rancher2#1051 (comment) Code snippet as below: terraform {
required_providers {
rancher2 = {
source = "rancher/rancher2"
version = "0.0.0-master"
}
}
}
provider "rancher2" {
api_url = "RANCHER_URL"
access_key = "RANCHER_ACCESS_TOKEN"
secret_key = "RANCHER_SECRET_KEY_FOR_TOKEN"
insecure = true
}
data "rancher2_cluster_v2" "foo-harvester" {
name = "vm"
}
# Create a new Cloud Credential for an imported Harvester cluster
resource "rancher2_cloud_credential" "foo-harvester" {
name = "foo-harvester"
harvester_credential_config {
cluster_id = data.rancher2_cluster_v2.foo-harvester.cluster_v1_id
cluster_type = "imported"
kubeconfig_content = data.rancher2_cluster_v2.foo-harvester.kube_config
}
}
# Create a new rancher2 machine config v2 using harvester node_driver
resource "rancher2_machine_config_v2" "foo-harvester-v2" {
generate_name = "harv"
harvester_config {
vm_namespace = "default"
cpu_count = "2"
memory_size = "4"
disk_info = <<EOF
{
"disks": [{
"imageName": "IMAGE_ID",
"size": 40,
"bootOrder": 1
},{
"storageClassName": "harvester-longhorn",
"size": 5,
"bootOrder": 2
}]
}
EOF
network_info = <<EOF
{
"interfaces": [{
"networkName": "VM_NETWORK_ID",
"macAddress": ""
},{
"networkName": "VM_NETWORK_ID",
"macAddress": ""
}]
}
EOF
ssh_user = "ubuntu"
user_data = <<EOF
#cloud-config
package_update: true
packages:
- qemu-guest-agent
runcmd:
- - systemctl
- enable
- '--now'
- qemu-guest-agent.service
password: password
chpasswd: {expire: False}
sshpwauth: True
EOF
network_data = <<EOF
version: 1
config:
- type: physical
name: enp1s0
subnets:
- type: dhcp
- type: physical
name: enp2s0
subnets:
- type: dhcp
EOF
}
}
resource "rancher2_cluster_v2" "foo-harvester-v2" {
name = "harv2"
kubernetes_version = "v1.24.9+rke2r2"
rke_config {
machine_pools {
name = "pool1"
cloud_credential_secret_name = rancher2_cloud_credential.foo-harvester.id
control_plane_role = true
etcd_role = true
worker_role = true
quantity = 1
machine_config {
kind = rancher2_machine_config_v2.foo-harvester-v2.kind
name = rancher2_machine_config_v2.foo-harvester-v2.name
}
}
machine_selector_config {
config = {
cloud-provider-name = ""
}
}
machine_global_config = <<EOF
cni: "calico"
disable-kube-proxy: false
etcd-expose-metrics: false
EOF
upgrade_strategy {
control_plane_concurrency = "10%"
worker_concurrency = "10%"
}
etcd {
snapshot_schedule_cron = "0 */5 * * *"
snapshot_retention = 5
}
chart_values = ""
}
} |
Is your feature request related to a problem? Please describe.
Additional context
The text was updated successfully, but these errors were encountered: