Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7504ae7
chore: Correct path for kubeconfig (#67)
nahsi Jan 10, 2025
7ca62e1
chore: fixed ccp-worker version (#68)
enjenjenje Jan 10, 2025
771fa0b
chore: Add release-please for terraform modules (#73)
nahsi Jan 13, 2025
1be56c5
lightmare chart -> 0.1.1 (#75)
enjenjenje Jan 13, 2025
ad4a63f
chore: Separate module releases (#77)
nahsi Jan 13, 2025
abd0011
chore: Bump module version in examples (#81)
nahsi Jan 13, 2025
7bf1b0e
chore: Fix path in extra-files version bump (#82)
nahsi Jan 13, 2025
0075bf4
chore: Correct version bump in examples (#86)
nahsi Jan 13, 2025
9363a02
chore(deps): update hashicorp/vault-action action to v3.1.0 (#66)
renovate[bot] Jan 13, 2025
4f2a1c8
chore(main): release terraform-module-spectrum 0.1.0 (#89)
fluencebot Jan 13, 2025
4bd07df
chore(main): release terraform-module-talos 0.1.0 (#88)
fluencebot Jan 13, 2025
7ae7a38
chore(main): release terraform-module-k3s 0.1.0 (#87)
fluencebot Jan 13, 2025
9436ed8
chore(deps): update helm release kubernetes-dashboard to v7.10.1 (#70)
renovate[bot] Jan 13, 2025
e56a220
feat: Update talos to version 1.9.1 and add selinux workaround (#90)
nahsi Jan 15, 2025
f818568
feat!: talos multinode initial support (#72)
nahsi Jan 15, 2025
c5d8f07
chore: Actually login to docker registry (#92)
nahsi Jan 15, 2025
ec30d50
chore: Fix kubeconfig missing (#93)
nahsi Jan 15, 2025
373c20e
chore: Fix kubeconfig
nahsi Jan 15, 2025
a948c5e
fix: kubeconfig creation waits for bootstrap (#94)
nahsi Jan 15, 2025
7a2bea9
chore(main): release terraform-module-talos 0.2.0 (#91)
fluencebot Jan 16, 2025
1357e46
chore: Bump kubevirt cdi (#96)
nahsi Jan 16, 2025
d23d5b8
feat: Setup system metrics collection (host, k8s, cilium, kubevirt) (…
nahsi Jan 23, 2025
92e8605
fix: Bump talos version to 1.9.2 (#98)
nahsi Jan 23, 2025
00ddfc7
chore(main): release terraform-module-spectrum 0.1.1 (#99)
fluencebot Jan 23, 2025
cec66d0
chore(main): release terraform-module-talos 0.2.1 (#100)
fluencebot Jan 23, 2025
fa57329
fix: Disable creation of service monitor for now (#102)
nahsi Jan 23, 2025
1487362
chore(main): release terraform-module-spectrum 0.1.1 (#101)
fluencebot Jan 23, 2025
e9f4203
chore: Fix dependency on service-monitor and collect metrics from kub…
nahsi Jan 24, 2025
db0b347
chore: Disable eip on ephemeral instance (#108)
nahsi Jan 28, 2025
606d9e4
chore: Test metrics push (#107)
nahsi Jan 29, 2025
9c5f7e5
feat: update ccp-cu-worker to 0.16.1 (#109)
mikevoronov Jan 30, 2025
e30d7e0
chore(deps): update dependency rancher/local-path-provisioner to v0.0…
renovate[bot] Jan 30, 2025
9109a14
Merge branch 'testnet' into main
nahsi Jan 30, 2025
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
13 changes: 10 additions & 3 deletions .github/release-please/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"initial-version": "0.1.0",
"separate-pull-requests": true,
"packages": {
"terraform-modules/spectrum": {
"component": "terraform-module-spectrum"
"component": "terraform-module-spectrum",
"extra-files": [
"/examples/k3s/spectrum.tf",
"/examples/talos/spectrum.tf"
]
},
"terraform-modules/k3s": {
"component": "terraform-module-k3s"
"component": "terraform-module-k3s",
"extra-files": ["/examples/k3s/main.tf"]
},
"terraform-modules/talos": {
"component": "terraform-module-talos"
"component": "terraform-module-talos",
"extra-files": ["/examples/talos/main.tf"]
}
}
}
6 changes: 5 additions & 1 deletion .github/release-please/manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
{}
{
"terraform-modules/talos": "0.2.1",
"terraform-modules/spectrum": "0.1.1",
"terraform-modules/k3s": "0.1.0"
}
4 changes: 2 additions & 2 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
ref: ${{ inputs.command == 'destroy' && 'main' || inputs.branch }}

- name: Get Vault token
uses: hashicorp/vault-action@v3.0.0
uses: hashicorp/vault-action@v3.1.0
with:
url: "https://vault.fluence.dev"
path: jwt/github
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
run: |
case ${{ inputs.command }} in
create)
terraform apply -target module.talos.kubeconfig.path -auto-approve
terraform apply -target module.talos.local_sensitive_file.kubeconfig -auto-approve
terraform apply -auto-approve
;;
destroy)
Expand Down
12 changes: 4 additions & 8 deletions ephemeral/instance.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ resource "digitalocean_ssh_key" "spectrum" {
}

data "digitalocean_image" "talos" {
name = "talos-v1.8.4"
name = "talos-v1.9.2"
}

resource "digitalocean_droplet" "talos" {
name = "rnd-${local.prefix}-spectrum-cp"
resource "digitalocean_droplet" "cp" {
count = 1
name = "rnd-${local.prefix}-spectrum-cp-${count.index}"
size = "s-8vcpu-16gb"
image = data.digitalocean_image.talos.id
region = "fra1"
Expand All @@ -30,8 +31,3 @@ resource "digitalocean_droplet" "talos" {
local.prefix,
]
}

resource "digitalocean_reserved_ip" "l2" {
droplet_id = digitalocean_droplet.talos.id
region = digitalocean_droplet.talos.region
}
17 changes: 12 additions & 5 deletions ephemeral/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,18 @@ data "vault_generic_secret" "docker" {
module "talos" {
source = "../terraform-modules/talos"
cluster_name = local.prefix
server_ip = digitalocean_droplet.talos.ipv4_address

config_patches = [
file("${path.root}/config_patch.yml"),
control_planes = [
{
name = "cp-0"
server_ip = digitalocean_droplet.cp[0].ipv4_address
config_patches = [
templatefile("${path.root}/patches/registry.yml", {
docker_username = data.vault_generic_secret.docker.data.username,
docker_password = data.vault_generic_secret.docker.data.password
})
]
},
]
}

Expand All @@ -36,7 +44,6 @@ module "spectrum" {
DOTOKEN = base64encode(data.vault_generic_secret.spectrum.data.token)
DOMAIN = "${local.prefix}.fluence.dev"
PREFIX = local.prefix
LOADBALANCER_IP = digitalocean_droplet.talos.ipv4_address
L2_IP = digitalocean_reserved_ip.l2.ip_address
LOADBALANCER_IP = digitalocean_droplet.cp[0].ipv4_address
}
}
File renamed without changes.
14 changes: 1 addition & 13 deletions examples/k3s/main.tf
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
module "k3s" {
source = "github.com/fluencelabs/spectrum//terraform-modules/k3s"
source = "git::https://github.com/fluencelabs/spectrum.git//terraform-modules/k3s?ref=terraform-module-k3s-v0.1.0" # x-release-please-version
kubeconfigs_location = "${path.root}/secrets"
server_name = local.server_name
server_ip_address = local.server_ip_address
ssh_key = local.ssh_key
ssh_user = local.ssh_user
ssh_port = local.ssh_port
}

provider "helm" {
kubernetes {
config_path = module.k3s.kubeconfig_file
}
}

module "spectrum" {
depends_on = [module.k3s]
source = "github.com/fluencelabs/spectrum//terraform-modules/spectrum"
cluster_flavour = "k3s"
}
11 changes: 11 additions & 0 deletions examples/k3s/spectrum.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
provider "helm" {
kubernetes {
config_path = module.k3s.kubeconfig_file
}
}

module "spectrum" {
depends_on = [module.k3s]
source = "git::https://github.com/fluencelabs/spectrum.git//terraform-modules/spectrum?ref=terraform-module-spectrum-v0.1.1" # x-release-please-version
cluster_flavour = "k3s"
}
4 changes: 2 additions & 2 deletions examples/talos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## Server customization

In talos machine is configured from a single configuration file in yaml format. Talos terraform module allows to specify overlays of the main configuration file maintained by cloudless labs [here](https://github.com/fluencelabs/spectrum/blob/main/terraform-modules/talos/templates/controlplane_patch.yml) with `config_pathes` option.
In talos machine is configured from a single configuration file in yaml format. Talos terraform module allows to specify overlays of the main configuration file maintained by cloudless labs [here](https://github.com/fluencelabs/spectrum/blob/main/terraform-modules/talos/base_config.yml) with `config_pathes` option.

You can configure server specific things like layout of disks or network configuration. Checkout [talos documentation](https://www.talos.dev/v1.9/reference/configuration/v1alpha1/config/) and see `config_patch.yml` for an example of a `bond` interface configuration.
You can configure server specific things like layout of disks or network configuration. Checkout [talos documentation](https://www.talos.dev/v1.9/reference/configuration/v1alpha1/config/) and see [`cp-0.yml`](https://github.com/fluencelabs/blob/main/examples/talos/patches/cp-0.yml) for an example of a `bond` interface configuration.

## Terraform state

Expand Down
34 changes: 12 additions & 22 deletions examples/talos/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,17 @@ provider "helm" {
}

module "talos" {
source = "git::https://github.com/fluencelabs/spectrum.git//terraform-modules/talos?ref=main"
cluster_name = var.cluster_name
server_ip = var.server_ip
# config_patches = [
# file("${path.root}/config_patch.yml"),
# ]
}

module "spectrum" {
depends_on = [module.talos]
source = "git::https://github.com/fluencelabs/spectrum.git//terraform-modules/spectrum?ref=main"
network = "main"
cluster = "default"
}

variable "server_ip" {
type = string
description = "IP at which server is accessible"
}
source = "git::https://github.com/fluencelabs/spectrum.git//terraform-modules/talos?ref=terraform-module-talos-v0.2.1" # x-release-please-version
cluster_name = "my-cluster"

variable "cluster_name" {
type = string
description = "Name used in k8s and talos to distinguish between clusters"
control_planes = [
{
name = "cp-0"
server_ip = "1.2.3.4"
config_patches = [
file("${path.root}/patches/base.yml"),
file("${path.root}/patches/cp-0.yml"),
]
},
]
}
4 changes: 4 additions & 0 deletions examples/talos/patches/base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
machine:
time:
servers:
- time.cloudflare.com
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ machine:
serial: Y0L0A031T5N8

network:
hostname: foobar
interfaces:
- interface: bond0
dhcp: false
Expand Down
6 changes: 6 additions & 0 deletions examples/talos/spectrum.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module "spectrum" {
depends_on = [module.talos]
source = "git::https://github.com/fluencelabs/spectrum.git//terraform-modules/spectrum?ref=terraform-module-spectrum-v0.1.1" # x-release-please-version
network = "main"
cluster = "default"
}
2 changes: 0 additions & 2 deletions examples/talos/variables.auto.tfvars

This file was deleted.

2 changes: 1 addition & 1 deletion flux/apps/kubernetes-dashboard/helm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
chart:
spec:
chart: kubernetes-dashboard
version: 7.10.0
version: 7.10.1
sourceRef:
kind: HelmRepository
name: kubernetes-dashboard
Expand Down
2 changes: 1 addition & 1 deletion flux/clusters/ephemeral/grafana-ingress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Namespace
metadata:
name: monitoring
labels:
app.kubernetes.io/component: monitoring
app.kubernetes.io/component: spectrum-monitoring
pod-security.kubernetes.io/enforce: privileged
---
apiVersion: networking.k8s.io/v1
Expand Down
2 changes: 1 addition & 1 deletion flux/clusters/ephemeral/kustomization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ resources:
- ../../components/monitoring
- hubble-ingress.yml
- grafana-ingress.yml
- cilium-l2.yml
# - cilium-l2.yml
- lightmare.yml
4 changes: 2 additions & 2 deletions flux/components/kubevirt/app/kustomization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ kind: Kustomization
resources:
- https://github.com/kubevirt/kubevirt/releases/download/v1.4.0/kubevirt-operator.yaml
- https://github.com/kubevirt/kubevirt/releases/download/v1.4.0/kubevirt-cr.yaml
- https://github.com/kubevirt/containerized-data-importer/releases/download/v1.60.3/cdi-operator.yaml
- https://github.com/kubevirt/containerized-data-importer/releases/download/v1.60.3/cdi-cr.yaml
- https://github.com/kubevirt/containerized-data-importer/releases/download/v1.61.0/cdi-operator.yaml
- https://github.com/kubevirt/containerized-data-importer/releases/download/v1.61.0/cdi-cr.yaml
patches:
- target:
kind: Deployment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ configMapGenerator:
- dashboards/cluster.json
- dashboards/logs.json
options:
annotations:
grafana_folder: "Flux"
labels:
grafana_dashboard: "1"
app.kubernetes.io/part-of: flux
app.kubernetes.io/component: monitoring
app.kubernetes.io/part-of: spectrum-monitoring
app.kubernetes.io/component: flux
kustomize.toolkit.fluxcd.io/substitute: disabled
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ kind: PodMonitor
metadata:
name: flux-system
labels:
app.kubernetes.io/part-of: flux
app.kubernetes.io/component: monitoring
app.kubernetes.io/part-of: spectrum-monitoring
app.kubernetes.io/component: flux
spec:
namespaceSelector:
matchNames:
Expand Down
28 changes: 28 additions & 0 deletions flux/components/monitoring/configs/kubernetes/kustomization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: monitoring
generatorOptions:
disableNameSuffixHash: true
labels:
grafana_dashboard: "1"
app.kubernetes.io/component: kubernetes
app.kubernetes.io/part-of: spectrum-monitoring
commonAnnotations:
grafana_folder: "Kubernetes"

configMapGenerator:
- name: dashboards-k8s-views-global
files:
- https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/refs/tags/v2.5.3/dashboards/k8s-views-global.json

- name: dashboards-k8s-views-namespaces
files:
- https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/refs/tags/v2.5.3/dashboards/k8s-views-namespaces.json

- name: dashboards-k8s-views-nodes
files:
- https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/refs/tags/v2.5.3/dashboards/k8s-views-nodes.json

- name: dashboards-k8s-views-pods
files:
- https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/refs/tags/v2.5.3/dashboards/k8s-views-pods.json
16 changes: 16 additions & 0 deletions flux/components/monitoring/configs/kubevirt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: kubevirt-monitoring
namespace: flux-system
spec:
interval: 1m0s
path: ./flux/components/monitoring/configs/kubevirt
prune: true
sourceRef:
kind: GitRepository
name: spectrum
namespace: flux-system
dependsOn:
- name: kubevirt
namespace: flux-system
18 changes: 18 additions & 0 deletions flux/components/monitoring/configs/kubevirt/kustomization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: monitoring
resources:
- service-monitor.yml
generatorOptions:
disableNameSuffixHash: true
labels:
grafana_dashboard: "1"
app.kubernetes.io/part-of: spectrum-monitoring
app.kubernetes.io/component: kubevirt
commonAnnotations:
grafana_folder: "Kubevirt"

configMapGenerator:
- name: dashboards-k8s-kubevirt
files:
- https://raw.githubusercontent.com/aenix-io/cozystack/refs/tags/v0.23.1/dashboards/kubevirt/kubevirt-control-plane.json
19 changes: 19 additions & 0 deletions flux/components/monitoring/configs/kubevirt/service-monitor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: kubevirt
labels:
app.kubernetes.io/part-of: spectrum-monitoring
app.kubernetes.io/component: kubevirt
spec:
selector:
matchLabels:
prometheus.kubevirt.io: "true"
namespaceSelector:
matchNames:
- kubevirt
endpoints:
- port: metrics
scheme: https
tlsConfig:
insecureSkipVerify: true
7 changes: 7 additions & 0 deletions flux/components/monitoring/configs/kustomization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- flux
- system
- kubernetes
- kubevirt.yml
Loading
Loading