-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
revert provider docs to previous version
Signed-off-by: Sebastian Hoß <[email protected]>
- Loading branch information
Showing
4 changed files
with
192 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
terraform { | ||
required_providers { | ||
# define local alias banzaicloud provider | ||
banzaicloud-k8s = { | ||
source = "banzaicloud/k8s" | ||
version = "0.9.1" | ||
} | ||
# define another alias for metio provider | ||
metio-k8s = { | ||
source = "metio/k8s" | ||
version = "> 2024.3.30" | ||
} | ||
} | ||
} | ||
|
||
provider "banzaicloud-k8s" { | ||
# Configuration options for banzaicloud's provider | ||
} | ||
provider "metio-k8s" { | ||
# we need no configuration | ||
} | ||
|
||
# declare any resource from the k8s provider | ||
data "k8s_monitoring_coreos_com_pod_monitor_v1_manifest" "example" { | ||
# be explicit about the provider to use | ||
provider = metio-k8s | ||
|
||
metadata = { | ||
name = "example" | ||
} | ||
spec = { | ||
pod_metrics_endpoints = [ | ||
{ | ||
path = "/metrics" | ||
port = "metrics" | ||
} | ||
] | ||
selector = { | ||
match_labels = { | ||
"app.kubernetes.io/name" = "some-name" | ||
} | ||
} | ||
} | ||
} | ||
|
||
# use the 'yaml' attribute as input for the k8s provider by banzaicloud | ||
resource "k8s_manifest" "example" { | ||
# be explicit about the provider to use | ||
provider = banzaicloud-k8s | ||
|
||
content = data.k8s_monitoring_coreos_com_pod_monitor_v1_manifest.example.yaml | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# declare any resource from the k8s provider | ||
data "k8s_monitoring_coreos_com_pod_monitor_v1_manifest" "example" { | ||
metadata = { | ||
name = "example" | ||
} | ||
spec = { | ||
pod_metrics_endpoints = [ | ||
{ | ||
path = "/metrics" | ||
port = "metrics" | ||
} | ||
] | ||
selector = { | ||
match_labels = { | ||
"app.kubernetes.io/name" = "some-name" | ||
} | ||
} | ||
} | ||
} | ||
|
||
# use the 'yaml' attribute as input for the kubectl provider | ||
resource "kubectl_manifest" "example" { | ||
yaml_body = data.k8s_monitoring_coreos_com_pod_monitor_v1_manifest.example.yaml | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters