add grafana
ci / build (push) Waiting to run Details

This commit is contained in:
CJ_Clippy 2024-06-20 15:23:01 -08:00
parent 8583f5c481
commit aa1bf33856
6 changed files with 82 additions and 6 deletions

View File

@ -11,7 +11,7 @@ flux-prod:
./scripts/flux-bootstrap-prod.sh
flux-staging:
./scripts/flux-bootstrap-staging.sh
(cd ./scripts; ./flux-bootstrap-staging.expect)
dev: kind namespaces secrets chisel velero
@ -50,7 +50,7 @@ chisel:
./scripts/k8s-chisel-operator.sh
deps:
sudo pamac install make entr nvm minikube kubectl docker helm
sudo pamac install make entr nvm minikube kubectl docker helm expect
curl -fsSL https://raw.githubusercontent.com/tilt-dev/tilt/master/scripts/install.sh | bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
echo "go to https://github.com/txn2/kubefwd/releases/latest to get kubefwd"

View File

@ -0,0 +1,66 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: grafana
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: grafana
namespace: grafana
spec:
interval: 24h
url: https://grafana.github.io/helm-charts
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: grafana
namespace: grafana
spec:
interval: 30m
chart:
spec:
chart: grafana
version: "8.0.2"
sourceRef:
kind: HelmRepository
name: grafana
namespace: grafana
interval: 12h
values:
dashboardProviders:
dashboardproviders.yaml:
apiVersion: 1
providers:
- name: 'grafana-dashboards-kubernetes'
orgId: 1
folder: 'Kubernetes'
type: file
disableDeletion: true
editable: true
options:
path: /var/lib/grafana/dashboards/grafana-dashboards-kubernetes
dashboards:
grafana-dashboards-kubernetes:
k8s-system-api-server:
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-system-api-server.json
token: ''
k8s-system-coredns:
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-system-coredns.json
token: ''
k8s-views-global:
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-global.json
token: ''
k8s-views-namespaces:
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-namespaces.json
token: ''
k8s-views-nodes:
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-nodes.json
token: ''
k8s-views-pods:
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-pods.json
token: ''

View File

@ -4,3 +4,4 @@ resources:
- external-dns.yaml
- cert-manager.yaml
- ingress-nginx.yaml
- grafana.yaml

View File

@ -1,8 +1,8 @@
#!/usr/bin/env node
import dotenv from 'dotenv'
dotenv.config({ path: '../../.env' })
import { join } from 'node:path'
dotenv.config({ path: join(import.meta.dirname, '../../.env') })
const apiV2Base = 'https://api.vultr.com/v2'

View File

@ -0,0 +1,6 @@
#!/usr/bin/expect
spawn ./flux-bootstrap-staging.sh
expect -re ".*Please give the key access to your repository\?.*\[y/N\]"
send -- "y\r"
interact

View File

@ -1,4 +1,6 @@
#!/bin/bash
#!/usr/bin/sh
## this way is annoying because deployment asks for git password
# flux bootstrap git \
@ -9,9 +11,10 @@
# --token-auth=true \
# --path=clusters/staging
## this way is more automatic although it does ask for yes/no confirmation that the ssh key has repo access
flux bootstrap git \
--url="ssh://git@gitea.futureporn.net:2222/futureporn/fp" \
--branch=main \
--path="clusters/staging" \
--private-key-file=/home/cj/.ssh/fp-flux
--private-key-file=/home/cj/.ssh/fp-flux