mirror of
https://github.com/devitq/yandexcloud-k3s.git
synced 2026-09-20 21:40:34 +00:00
Compare commits
4
Commits
48f67a284e
...
f75a407559
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f75a407559 | ||
|
|
afc0ee67a6 | ||
|
|
80d2aa9d52 | ||
|
|
9e407d7fc2 |
@@ -60,19 +60,22 @@ runcmd:
|
|||||||
--disable coredns,traefik,local-storage,metrics-server,runtimes \
|
--disable coredns,traefik,local-storage,metrics-server,runtimes \
|
||||||
--disable-network-policy \
|
--disable-network-policy \
|
||||||
--disable-kube-proxy \
|
--disable-kube-proxy \
|
||||||
|
--disable-cloud-controller \
|
||||||
|
--disable-helm-controller \
|
||||||
--flannel-backend none \
|
--flannel-backend none \
|
||||||
--egress-selector-mode agent \
|
--egress-selector-mode agent \
|
||||||
--servicelb-namespace kube-system \
|
--servicelb-namespace kube-system \
|
||||||
--nonroot-devices \
|
--nonroot-devices \
|
||||||
|
--secrets-encryption \
|
||||||
--secrets-encryption-provider secretbox \
|
--secrets-encryption-provider secretbox \
|
||||||
--lb-server-port 6444 \
|
--lb-server-port 6444 \
|
||||||
|
--etcd-expose-metrics \
|
||||||
--write-kubeconfig-mode 0600 \
|
--write-kubeconfig-mode 0600 \
|
||||||
--write-kubeconfig-group root \
|
--write-kubeconfig-group root \
|
||||||
--write-kubeconfig ${k3s_dir}/kubeconfig/config \
|
--write-kubeconfig ${k3s_dir}/kubeconfig/config \
|
||||||
--image-credential-provider-bin-dir /var/lib/rancher/credentialprovider/bin \
|
--image-credential-provider-bin-dir /var/lib/rancher/credentialprovider/bin \
|
||||||
--image-credential-provider-config /var/lib/rancher/credentialprovider/config.yaml \
|
--image-credential-provider-config /var/lib/rancher/credentialprovider/config.yaml \
|
||||||
--data-dir=${k3s_dir} \
|
--data-dir=${k3s_dir}" sh -
|
||||||
--default-local-storage-path=${k3s_dir}/storage" sh -
|
|
||||||
- |
|
- |
|
||||||
curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
|
curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
|
||||||
- |
|
- |
|
||||||
|
|||||||
@@ -59,19 +59,22 @@ runcmd:
|
|||||||
--disable coredns,traefik,local-storage,metrics-server,runtimes \
|
--disable coredns,traefik,local-storage,metrics-server,runtimes \
|
||||||
--disable-network-policy \
|
--disable-network-policy \
|
||||||
--disable-kube-proxy \
|
--disable-kube-proxy \
|
||||||
|
--disable-cloud-controller \
|
||||||
|
--disable-helm-controller \
|
||||||
--flannel-backend none \
|
--flannel-backend none \
|
||||||
--egress-selector-mode agent \
|
--egress-selector-mode agent \
|
||||||
--servicelb-namespace kube-system \
|
--servicelb-namespace kube-system \
|
||||||
--nonroot-devices \
|
--nonroot-devices \
|
||||||
|
--secrets-encryption \
|
||||||
--secrets-encryption-provider secretbox \
|
--secrets-encryption-provider secretbox \
|
||||||
--lb-server-port 6444 \
|
--lb-server-port 6444 \
|
||||||
|
--etcd-expose-metrics \
|
||||||
--write-kubeconfig-mode 0600 \
|
--write-kubeconfig-mode 0600 \
|
||||||
--write-kubeconfig-group root \
|
--write-kubeconfig-group root \
|
||||||
--write-kubeconfig ${k3s_dir}/kubeconfig/config \
|
--write-kubeconfig ${k3s_dir}/kubeconfig/config \
|
||||||
--image-credential-provider-bin-dir /var/lib/rancher/credentialprovider/bin \
|
--image-credential-provider-bin-dir /var/lib/rancher/credentialprovider/bin \
|
||||||
--image-credential-provider-config /var/lib/rancher/credentialprovider/config.yaml \
|
--image-credential-provider-config /var/lib/rancher/credentialprovider/config.yaml \
|
||||||
--data-dir=${k3s_dir} \
|
--data-dir=${k3s_dir}" sh -
|
||||||
--default-local-storage-path=${k3s_dir}/storage" sh -
|
|
||||||
- |
|
- |
|
||||||
mkdir -p /home/ubuntu/.kube
|
mkdir -p /home/ubuntu/.kube
|
||||||
cp ${k3s_dir}/kubeconfig/config /home/ubuntu/.kube/config
|
cp ${k3s_dir}/kubeconfig/config /home/ubuntu/.kube/config
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ resource "terraform_data" "k8s_main_master_user_data" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource "yandex_compute_instance" "k8s_main_master" {
|
resource "yandex_compute_instance" "k8s_main_master" {
|
||||||
name = "k8s-master"
|
name = "master-0-ru-central1-d-k8s"
|
||||||
hostname = local.k8s_main_master_fqdn
|
hostname = local.k8s_main_master_fqdn
|
||||||
description = "Salt, ansible and kubernetes master, provisions other nodes"
|
description = "Salt, ansible and kubernetes master, provisions other nodes"
|
||||||
platform_id = "standard-v3"
|
platform_id = "standard-v3"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ resource "yandex_compute_instance_group" "k8s_master" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
instance_template {
|
instance_template {
|
||||||
name = "k8s-master-{instance.index_in_zone}-{instance.zone_id}"
|
name = "master-{instance.index_in_zone}-{instance.zone_id}-k8s"
|
||||||
hostname = "master-{instance.index_in_zone}.{instance.zone_id}.k8s.internal"
|
hostname = "master-{instance.index_in_zone}.{instance.zone_id}.k8s.internal"
|
||||||
labels = {
|
labels = {
|
||||||
"instance-group" = "master"
|
"instance-group" = "master"
|
||||||
@@ -105,10 +105,10 @@ resource "yandex_compute_instance_group" "k8s_master" {
|
|||||||
ignore_health_checks = true
|
ignore_health_checks = true
|
||||||
}
|
}
|
||||||
health_check {
|
health_check {
|
||||||
healthy_threshold = 2
|
healthy_threshold = 3
|
||||||
unhealthy_threshold = 2
|
unhealthy_threshold = 3
|
||||||
interval = 2
|
interval = 10
|
||||||
timeout = 1
|
timeout = 9
|
||||||
|
|
||||||
tcp_options {
|
tcp_options {
|
||||||
port = 6443
|
port = 6443
|
||||||
@@ -135,7 +135,7 @@ resource "yandex_compute_instance_group" "k8s_worker" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
instance_template {
|
instance_template {
|
||||||
name = "k8s-worker-{instance.index_in_zone}-{instance.zone_id}"
|
name = "worker-{instance.index_in_zone}-{instance.zone_id}-k8s"
|
||||||
hostname = "worker-{instance.index_in_zone}.{instance.zone_id}.k8s.internal"
|
hostname = "worker-{instance.index_in_zone}.{instance.zone_id}.k8s.internal"
|
||||||
labels = {
|
labels = {
|
||||||
"instance-group" = "worker"
|
"instance-group" = "worker"
|
||||||
@@ -230,10 +230,10 @@ resource "yandex_compute_instance_group" "k8s_worker" {
|
|||||||
ignore_health_checks = true
|
ignore_health_checks = true
|
||||||
}
|
}
|
||||||
health_check {
|
health_check {
|
||||||
healthy_threshold = 2
|
healthy_threshold = 3
|
||||||
unhealthy_threshold = 2
|
unhealthy_threshold = 3
|
||||||
interval = 2
|
interval = 10
|
||||||
timeout = 1
|
timeout = 9
|
||||||
|
|
||||||
tcp_options {
|
tcp_options {
|
||||||
port = 80
|
port = 80
|
||||||
|
|||||||
Reference in New Issue
Block a user