Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kubernetes-infra
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cloud
terraform
modules
kubernetes-infra
Commits
0dc5a910
Commit
0dc5a910
authored
1 year ago
by
Ing. Klára Moravcová
Browse files
Options
Downloads
Patches
Plain Diff
Modify inventory to use instance name.
parent
94dfc7a0
No related branches found
No related tags found
1 merge request
!1
Inventory modify
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ansible_inventory.tmpl
+12
-12
12 additions, 12 deletions
ansible_inventory.tmpl
inventory.tf
+3
-1
3 additions, 1 deletion
inventory.tf
with
15 additions
and
13 deletions
ansible_inventory.tmpl
+
12
−
12
View file @
0dc5a910
[all]
[all]
%{ for i
ndex,ip
in k8s_
master_ip
~}
%{ for i
, name
in k8s_
control_name
~}
control${index+1} ansible_host=${ip
}
${name} ansible_host=${element(k8s_control_ip, i)
}
%{ endfor ~}
%{ endfor ~}
%{ for i
ndex,ip
in k8s_worker_
ip
~}
%{ for i
, name
in k8s_worker_
name
~}
node${index+1}
ansible_host=${
ip
}
${name}
ansible_host=${
element(k8s_worker_ip, i)
}
%{ endfor ~}
%{ endfor ~}
## configure a bastion host if your nodes are not directly reachable
## configure a bastion host if your nodes are not directly reachable
...
@@ -12,21 +12,21 @@ node${index+1} ansible_host=${ip}
...
@@ -12,21 +12,21 @@ node${index+1} ansible_host=${ip}
bastion ansible_host=${k8s_bastion_ip} ansible_user=${bastion_ssh_user_name}
bastion ansible_host=${k8s_bastion_ip} ansible_user=${bastion_ssh_user_name}
[kube_control_plane]
[kube_control_plane]
%{ for
index,ip in k8s_master_ip
~}
%{ for
name in k8s_control_name
~}
control${index+1
}
${name
}
%{ endfor ~}
%{ endfor ~}
[etcd]
[etcd]
%{ for
index,ip in k8s_master_ip
~}
%{ for
name in k8s_control_name
~}
control${index+1
}
${name
}
%{ endfor ~}
%{ endfor ~}
[kube_node]
[kube_node]
%{ for
index,ip in k8s_master_ip
~}
%{ for
name in k8s_control_name
~}
control${index+1
}
${name
}
%{ endfor ~}
%{ endfor ~}
%{ for
index,ip
in k8s_worker_
ip
~}
%{ for
name
in k8s_worker_
name
~}
node${index+1
}
${name
}
%{ endfor ~}
%{ endfor ~}
[calico_rr]
[calico_rr]
...
...
This diff is collapsed.
Click to expand it.
inventory.tf
+
3
−
1
View file @
0dc5a910
...
@@ -3,7 +3,9 @@ resource "local_file" "k8s_file" {
...
@@ -3,7 +3,9 @@ resource "local_file" "k8s_file" {
{
{
bastion_ssh_user_name
=
var
.
bastion_ssh_user_name
bastion_ssh_user_name
=
var
.
bastion_ssh_user_name
k8s_bastion_ip
=
openstack_networking_floatingip_v2
.
bastion_fip
.
address
k8s_bastion_ip
=
openstack_networking_floatingip_v2
.
bastion_fip
.
address
k8s_control_ip
=
openstack_compute_instance_v2
.
control_nodes
.*.
access_ip_v4
k8s_control_name
=
openstack_compute_instance_v2
.
control_nodes
.*.
name
k8s_control_ip
=
openstack_compute_instance_v2
.
control_nodes
.*.
access_ip_v4
k8s_worker_name
=
openstack_compute_instance_v2
.
worker_nodes
.*.
name
k8s_worker_ip
=
openstack_compute_instance_v2
.
worker_nodes
.*.
access_ip_v4
k8s_worker_ip
=
openstack_compute_instance_v2
.
worker_nodes
.*.
access_ip_v4
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment