Skip to content

Instantly share code, notes, and snippets.

rules:
- expr: sum(rate(container_cpu_usage_seconds_total{job="kubelet",container!="",container!="POD"}[2m])) by (namespace,pod)
record: pod:container_cpu_usage:sum
- expr: sum(kube_pod_container_resource_requests{container!=""}) by (namespace, pod, resource)
record: kube_pod_resource_request
- expr: sum(kube_pod_container_resource_limits{container!=""}) by (namespace, pod, resource)
record: kube_pod_resource_limit
- expr: sum(container_network_receive_bytes_total{}) by(namespace,pod,interface) * 0
record: pod_network_name_info
- expr: sum(container_fs_usage_bytes{}) by (namespace, pod)
globals {
providers = ["name1", "name2"]
}
generate_hcl "example.tf" {
content {
tm_dynamic "resource1" {
for_each = tm_toset(global.providers)
iterator = i
$ cat example.tf
// TERRAMATE: GENERATED AUTOMATICALLY DO NOT EDIT
resource1 {
provider = "name1"
}
resource1 {
provider = "name2"
}
resource2 {
@identw
identw / stack.tm.hcl
Created September 4, 2023 08:10
terramate example tm_dynamic how to generate few resources for each provider
globals {
providers = ["name1", "name2"]
}
generate_hcl "example.tf" {
content {
tm_dynamic "resource1" {
for_each = tm_toset(global.providers)
iterator = i
/*
duration: 4210.015 ms
parameters: $1 = 'networking', $2 = 'networking', $3 = 'networking', $4 = 'networking', $5 = 'group', $6 = '{"\"group-name\""}'
*/
WITH inactive_nodes AS (
SELECT
certname
FROM
certnames
WHERE
/*
duration: 72.267 ms
parameters: $1 = 'networking', $2 = 'random-string', $3 = 'group', $4 = '{"\"group-name\""}'
*/
WITH inactive_nodes AS (
SELECT
certname
FROM
certnames
WHERE
$ cat Dockerfile
FROM docker.io/node:18.18.2
LABEL ttt=aa
WORKDIR /app
COPY ./yarn.lock ./
COPY ./package.json ./
RUN yarn install --frozen-lockfile --ignore-platform
RUN find /usr/local/share/.cache/yarn
RUN ls -la /usr/local/share/.cache/yarn/v6/npm-@parcel-watcher-win32-x64-2.3.0-14e7246289861acc589fd608de39fe5d8b4bb0a7-integrity/node_modules/@parcel/watcher-win32-x64/
kubeProxyReplacement: strict
k8sServicePort: 443
bpf:
masquerade: true
extraConfig:
install-no-conntrack-iptables-rules: "true"
bandwidthManager:
enabled: true
eni:
enabled: true
{
"cniVersion": "0.3.1",
"name": "cilium",
"plugins": [
{
"cniVersion": "0.3.1",
"eni": {
"first-interface-index": 1,
"subnet-tags": {
"Cilium": "Owned",
data "cloudinit_config" "this" {
base64_encode = true
gzip = false
boundary = "//"
part {
content_type = "text/x-shellscript"
content = <<-EOT
set -x
KUBELET_CONFIG=/etc/kubernetes/kubelet/kubelet-config.json