Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,20 @@ jobs:
FOXGLOVE_API_URL: ${{ vars.TEST_PRIMARY_SITE_API_URL }}
FOXGLOVE_SITE_TOKEN: ${{ secrets.TEST_PRIMARY_SITE_TOKEN }}
run: ./tests/test-primary-site-chart.sh ./charts/primary-site

test_external_connector:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Start minio
run: docker compose up minio -d
working-directory: tests
- name: Create minio buckets
run: docker compose up createbuckets
working-directory: tests
- uses: medyagh/setup-minikube@v0.0.20
with:
addons: metrics-server
- name: Test external connector chart install
timeout-minutes: 5
run: ./tests/test-external-connector-chart.sh ./charts/external-connector
16 changes: 16 additions & 0 deletions charts/external-connector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v2
name: external-connector
description: Foxglove External Connector
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
#
# Example versions:
# 1.0.0-alpha.0
# 1.0.0-alpha.1
# 1.0.0
version: "0.0.1"

appVersion: "b891fd66730df90b7101d2b39cf6c1e777e32da3"
9 changes: 9 additions & 0 deletions charts/external-connector/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Welcome to your Foxglove External Connector!

See the status of your release:

helm status -n foxglove foxglove-external-connector

Complete your installation:

https://docs.foxglove.dev/docs/visualization/connecting/external-connector
145 changes: 145 additions & 0 deletions charts/external-connector/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
{{- $deployment := .Values.externalConnector.deployment -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: external-connector
labels:
app: external-connector
spec:
replicas: {{ $deployment.replicas }}
selector:
matchLabels:
app: external-connector
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
template:
metadata:
labels:
app: external-connector
{{- range $key, $value := $deployment.podLabels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
annotations:
{{- range $key, $value := $deployment.podAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
volumes:
- name: gcp-cloud-credentials
secret:
secretName: gcp-cloud-credential
optional: true
{{- if $deployment.extraVolumes }}
{{- toYaml $deployment.extraVolumes | nindent 8 }}
{{- end }}
{{- if $deployment.initContainers }}
initContainers:
{{- toYaml $deployment.initContainers | nindent 8 }}
{{- end }}
containers:
- name: external-connector
image: {{ $deployment.image }}:{{ .Chart.AppVersion }}
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
runAsUser: 65534
runAsGroup: 65534
resources:
{{- with $deployment.resources }}
requests:
cpu: {{ .requests.cpu }}
memory: {{ .requests.memory }}
limits:
cpu: {{ .limits.cpu }}
memory: {{ .limits.memory }}
{{- end }}
ports:
- name: http
containerPort: 8080
- name: metrics
containerPort: 6001
volumeMounts:
- mountPath: /secrets
name: gcp-cloud-credentials
{{- if $deployment.extraVolumeMounts }}
{{- toYaml $deployment.extraVolumeMounts | nindent 12 }}
{{- end }}
envFrom:
# Secret used to grant access to cache bucket
- secretRef:
name: cloud-credentials
optional: true
# Secret used to key used to encrypt cookies
- secretRef:
name: cookie-encryption-key
optional: true
{{- range $k := .Values.globals.secrets }}
- secretRef:
name: {{ $k }}
{{- end }}
env:
{{- with lookup "v1" "Secret" .Release.Namespace "gcp-cloud-credential" }}
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /secrets/credentials.json
{{- end }}
{{- if .Values.globals.proxy.enabled }}
- name: HTTP_PROXY
value: {{ .Values.globals.proxy.httpProxy }}
- name: HTTPS_PROXY
value: {{ .Values.globals.proxy.httpsProxy }}
- name: NO_PROXY
value: {{ .Values.globals.proxy.noProxy }}
{{- end }}
- name: ADDRESS
value: "0.0.0.0:8080"
- name: PROMETHEUS_ADDRESS
value: "0.0.0.0:6001"
- name: AWS_REGION
value: "{{ .Values.globals.aws.region }}"
- name: AWS_SDK_LOAD_CONFIG
value: "true"
- name: PROMETHEUS_METRICS_NAMESPACE
value: "{{ $deployment.metrics.namespace }}"
- name: PROMETHEUS_METRICS_SUBSYSTEM
value: "{{ $deployment.metrics.subsystem }}"
- name: EXTERNAL_CONNECTOR_VERSION
value: "{{ .Chart.Version }}"
{{- range $item := $deployment.env }}
- name: {{ $item.name }}
value: {{ $item.value | quote}}
{{- end }}
startupProbe:
httpGet:
port: 8080
path: "/liveness"
initialDelaySeconds: 1
periodSeconds: 1
timeoutSeconds: 1
failureThreshold: 30
readinessProbe:
httpGet:
port: 8080
path: /liveness
periodSeconds: 3
timeoutSeconds: 1
failureThreshold: 10
livenessProbe:
httpGet:
port: 8080
path: /liveness
periodSeconds: 3
timeoutSeconds: 1
failureThreshold: 20
terminationGracePeriodSeconds: {{ $deployment.terminationGracePeriodSeconds }}
{{- if $deployment.serviceAccount.enabled }}
serviceAccount: external-connector
{{- end }}
{{- if $deployment.nodeSelectors }}
nodeSelector:
{{- range $key, $value := $deployment.nodeSelectors }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end}}
22 changes: 22 additions & 0 deletions charts/external-connector/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{- with .Values.externalConnector.autoscaling -}}
{{- if .enabled -}}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: external-connector
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: external-connector
minReplicas: {{ .minReplicas }}
maxReplicas: {{ .minReplicas }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .averageCpuUtilization }}
{{- end -}}
{{- end -}}
30 changes: 30 additions & 0 deletions charts/external-connector/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{- with .Values.ingress }}
{{- if .enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: external-connector
annotations:
{{- range $key, $value := .annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- if .className }}
ingressClassName: {{ .className | quote }}
{{- end }}
{{- if .tls }}
tls: {{- .tls | toYaml | trim | nindent 4 }}
{{- end }}
rules:
- host: {{ .host }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: external-connector
port:
number: 8080
{{- end }}
{{- end }}
20 changes: 20 additions & 0 deletions charts/external-connector/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: external-connector
annotations:
{{- range $key, $value := .Values.externalConnector.service.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
selector:
app: external-connector
ports:
- name: controller
protocol: TCP
port: 8080
targetPort: 8080
- name: metrics
protocol: TCP
port: 6001
targetPort: 6001
12 changes: 12 additions & 0 deletions charts/external-connector/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- with .Values.externalConnector.deployment.serviceAccount -}}
{{- if .enabled }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: external-connector
annotations:
{{- range $key, $value := .annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end -}}
{{- end -}}
Loading