-
Notifications
You must be signed in to change notification settings - Fork 216
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
[RFE] New Fields for Cluster Agent Customization feature #1097
Comments
QA Test TemplateIssue: #1097 ProblemCluster/Fleet agent deployment customization is not supported by the TFP. SolutionAdd TestingTest RC: v3.1.0-rc2 Engineering TestingThis feature has been tested on rke and v2 prov clusters (EKS) by provisioning with both cluster and agent deployment customization, updating the customization, and then removing it and adding it back and making sure the cluster and agent redeploys function as expected. Manual TestingTest plan
Note: you may not see cluster go into main.tf.rke_agent_customizationterraform {
required_providers {
rancher2 = {
source = "terraform.local/local/rancher2"
version = "1.0.0"
}
}
}
provider "rancher2" {
api_url = var.rancher_api_url
token_key = var.rancher_admin_bearer_token
insecure = true
}
data "rancher2_cloud_credential" "rancher2_cloud_credential" {
name = var.cloud_credential_name
}
resource "rancher2_cluster" "ablender-rke" {
name = var.rke_cluster_name
rke_config {
kubernetes_version = "v1.26.4-rancher2-1"
network {
plugin = var.rke_network_plugin
}
services {
etcd {
creation = "6h"
retention = "72h"
}
}
ingress {
default_backend = "false"
}
}
cluster_auth_endpoint {}
cluster_agent_deployment_customization {
append_tolerations {
effect = "NoSchedule"
key = "tolerate/control-plane-test"
value = "true"
}
override_affinity = <<EOF
{
"nodeAffinity": {
"requiredDuringSchedulingIgnoredDuringExecution": {
"nodeSelectorTerms": [{
"matchExpressions": [{
"key": "beta.kubernetes.io/os",
"operator": "NotIn",
"values": [
"windows"
]
}]
}]
}
}
}
EOF
override_resource_requirements {
cpu_limit = "800m"
cpu_request = "500m"
memory_limit = "800Mi"
memory_request = "500Mi"
}
}
fleet_agent_deployment_customization {
append_tolerations {
effect = "NoSchedule"
key = "tolerate/worker-test"
value = "true"
}
override_affinity = <<EOF
{
"nodeAffinity": {
"requiredDuringSchedulingIgnoredDuringExecution": {
"nodeSelectorTerms": [{
"matchExpressions": [{
"key": "not.this/nodepool",
"operator": "In",
"values": [
"true"
]
}]
}]
}
}
}
EOF
override_resource_requirements {
cpu_limit = "800m"
cpu_request = "500m"
memory_limit = "800Mi"
memory_request = "500Mi"
}
}
}
resource "rancher2_node_template" "rancher2_node_template" {
name = var.rke_node_template_name
amazonec2_config {
access_key = var.aws_access_key
secret_key = var.aws_secret_key
region = var.aws_region
ami = var.aws_ami
security_group = [var.aws_security_group_name]
subnet_id = var.aws_subnet_id
vpc_id = var.aws_vpc_id
zone = var.aws_zone_letter
root_size = var.aws_root_size
instance_type = var.aws_instance_type
}
}
resource "rancher2_node_pool" "pool1" {
cluster_id = rancher2_cluster.ablender-rke.id
name = "pool1"
hostname_prefix = "tf-pool1-"
node_template_id = rancher2_node_template.rancher2_node_template.id
quantity = 1
control_plane = true
etcd = true
worker = true
} main.tf.eks_agent_customizationterraform {
required_providers {
rancher2 = {
source = "terraform.local/local/rancher2"
version = "1.0.0"
}
}
}
provider "rancher2" {
api_url = var.rancher_api_url
token_key = var.rancher_admin_bearer_token
insecure = true
}
resource "rancher2_cloud_credential" "foo" {
name = "foo"
amazonec2_credential_config {
access_key = var.aws_access_key
secret_key = var.aws_secret_key
}
}
resource "rancher2_cluster" "foo" {
name = var.eks_name
description = "Terraform EKS cluster"
eks_config_v2 {
cloud_credential_id = rancher2_cloud_credential.foo.id
region = var.eks_region
kubernetes_version = var.eks_kube_version
subnets = var.eks_subnets
security_groups = var.eks_security_groups
node_groups {
name = "node_group1"
instance_type = var.eks_instance_type
desired_size = var.eks_desired_size
max_size = var.eks_max_size
min_size = var.eks_min_size
}
private_access = true
public_access = true
}
cluster_agent_deployment_customization {
append_tolerations {
effect = "NoSchedule"
key = "tolerate/worker-test"
value = "true"
}
override_affinity = <<EOF
{
"nodeAffinity": {
"requiredDuringSchedulingIgnoredDuringExecution": {
"nodeSelectorTerms": [{
"matchExpressions": [{
"key": "not.this/nodepool",
"operator": "In",
"values": [
"true"
]
}]
}]
}
}
}
EOF
override_resource_requirements {
cpu_limit = "800m"
cpu_request = "500m"
memory_limit = "800Mi"
memory_request = "500Mi"
}
}
fleet_agent_deployment_customization {
append_tolerations {
effect = "NoSchedule"
key = "tolerate/worker-test"
value = "true"
}
override_affinity = <<EOF
{
"nodeAffinity": {
"requiredDuringSchedulingIgnoredDuringExecution": {
"nodeSelectorTerms": [{
"matchExpressions": [{
"key": "not.this/nodepool",
"operator": "In",
"values": [
"true"
]
}]
}]
}
}
}
EOF
override_resource_requirements {
cpu_limit = "800m"
cpu_request = "500m"
memory_limit = "800Mi"
memory_request = "500Mi"
}
}
} Automated TestingAutomated structure tests were updated for
Run QA Testing ConsiderationsRegressions ConsiderationsTF agent customization support touches the create/update/deletion of all |
@slickwarren @thaneunsoo This is ready to test using https://github.com/rancher/terraform-provider-rancher2/releases/tag/v3.1.0-rc2. |
Implement TFP-side changes for supporting functionality to be added by rancher/rancher#41035
The text was updated successfully, but these errors were encountered: