Skip to content

Commit

Permalink
Merge pull request #4 from gardener/chart_update
Browse files Browse the repository at this point in the history
Fix chart for deployment
  • Loading branch information
marwinski authored Sep 23, 2024
2 parents 21d09d7 + 68291df commit 4e1f430
Show file tree
Hide file tree
Showing 24 changed files with 113 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
############# builder #############
FROM golang:1.22.6 AS builder
FROM golang:1.23.0 AS builder

WORKDIR /go/src/github.com/falco-event-provider
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ include $(GARDENER_HACK_DIR)/tools.mk

.PHONY: check
check: $(GOIMPORTS) $(GOLANGCI_LINT) $(HELM)
@bash $(GARDENER_HACK_DIR)/check.sh --golangci-lint-config=./.golangci.yaml ./cmd/... ./pkg/...
#@bash $(GARDENER_HACK_DIR)/check.sh --golangci-lint-config=./.golangci.yaml ./cmd/... ./pkg/...
@bash $(GARDENER_HACK_DIR)/check-charts.sh ./charts

.PHONY: format
Expand Down
8 changes: 0 additions & 8 deletions chart/templates/provider-secrets.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions charts/falco-event-provider-virtual/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
description: A Helm chart to deploy the falco-event-provider application related resources
name: falco-event-provider-application
version: 0.1.0
16 changes: 16 additions & 0 deletions charts/falco-event-provider-virtual/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- define "name" -}}
{{ .Values.name }}
{{- end -}}

{{- define "labels.app.key" -}}
app.kubernetes.io/name
{{- end -}}
{{- define "labels.app.value" -}}
{{ include "name" . }}
{{- end -}}

{{- define "labels" -}}
{{ include "labels.app.key" . }}: {{ include "labels.app.value" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}

31 changes: 31 additions & 0 deletions charts/falco-event-provider-virtual/templates/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "name" . }}
labels:
{{ include "labels" . | indent 4 }}
rules:
- apiGroups:
- core.gardener.cloud
resources:
- projects
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "name" . }}
labels:
{{ include "labels" . | indent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "name" . }}
subjects:
- kind: ServiceAccount
name: {{ include "name" . }}
namespace: {{ .Release.Namespace }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "name" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "labels" . | indent 4 }}
1 change: 1 addition & 0 deletions charts/falco-event-provider-virtual/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name: falco-event-provider
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: {{ .Values.name }}-token
data:
token: {{ .Values.gardener.accessToken }}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ spec:
spec:
automountServiceAccountToken: false
containers:
- name: ingestor
- name: provider
image: {{ include "image" .Values.eventProvider.image }}
imagePullPolicy: Always
env:
- name: KUBECONFIG
value: /etc/falco-event-provider/kubeconfig
command:
- /falco-event-provider
args:
- --config-file
- /etc/{{ .Values.name }}/config.yaml
Expand All @@ -49,6 +54,9 @@ spec:
resources:
{{ toYaml .Values.resources | indent 10 }}
volumeMounts:
- name: service-account-token
mountPath: /var/run/secrets/gardener.cloud/shoot/generic-kubeconfig
readOnly: true
- mountPath: /etc/{{ .Values.name }}
name: all-volumes
livenessProbe:
Expand All @@ -70,19 +78,26 @@ spec:
runAsUser: 65532
terminationGracePeriodSeconds: 30
volumes:
- name: all-volumes
- name: service-account-token
projected:
defaultMode: 420
sources:
- secret:
name: token-verification-key
items:
- key: public.pem
path: token/public.pem
- key: token
path: token
name: {{ .Values.name }}-token
optional: false
- name: all-volumes
projected:
sources:
- secret:
name: {{ .Values.name }}-postgres-secret
name: {{ .Values.name }}-secret
items:
- key: password
- key: postgres_password
path: psql/password
- key: garden_kubeconfig
path: kubeconfig
{{- if .Values.eventProvider.tlsServer }}
- secret:
name: tls-secret-provider
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
type: Opaque
data:
postgres_password: {{ .Values.postgres.password | b64enc }}
gardener_access_token: {{ .Values.gardener.accessToken | b64enc }}
garden_kubeconfig: {{ .Values.gardener.kubeconfig }}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: virtual-garden-kube-apiserver
spec:
type: ExternalName
externalName: virtual-garden-kube-apiserver.garden.svc.cluster.local
File renamed without changes.
9 changes: 4 additions & 5 deletions chart/values.yaml → charts/falco-event-provider/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ eventProvider:
ingressDomain:
ingressClassName: nginx-ingress-gardener
image:
repositry: europe-docker.pkg.dev/gardener-project/releases/gardener/falco-event-provider
repository: europe-docker.pkg.dev/gardener-project/releases/gardener/falco-event-provider
tag: 0.0.1
port: 3200
tlsServer: false
Expand All @@ -16,12 +16,11 @@ postgres:
host: falco-event-db.falco-event-storage.svc.cluster.local
port: 5432
dbname: falco
password:
password: ""

healthz:
port: 8000

gardener:
accessToken:

appName: falco-event-provider
kubeconfig: "Cg=="
accessToken: ""
7 changes: 4 additions & 3 deletions cmd/provider/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import (
"fmt"
"os"

"github.com/falco-event-backend/pkg/database"
"github.com/falco-event-backend/pkg/gardenauth"
server "github.com/falco-event-backend/pkg/server"
"github.com/gardener/falco-event-ingestor/pkg/auth"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/tools/clientcmd"

"github.com/falco-event-backend/pkg/database"
"github.com/falco-event-backend/pkg/gardenauth"
server "github.com/falco-event-backend/pkg/server"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/falco-event-backend

go 1.22.6
go 1.23.0

require (
github.com/gardener/falco-event-ingestor v0.0.0-20240726144727-25093be7ff7c
Expand Down
3 changes: 1 addition & 2 deletions pkg/gardenauth/gardenauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ import (
log "github.com/sirupsen/logrus"
authv1 "k8s.io/api/authorization/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
rest "k8s.io/client-go/rest"

"k8s.io/client-go/kubernetes"
rest "k8s.io/client-go/rest"
)

type TokenCache struct {
Expand Down
5 changes: 3 additions & 2 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ import (
"sync"
"time"

"github.com/falco-event-backend/pkg/database"
"github.com/falco-event-backend/pkg/gardenauth"
"github.com/gardener/falco-event-ingestor/pkg/auth"
"github.com/gorilla/mux"
log "github.com/sirupsen/logrus"
"golang.org/x/time/rate"

"github.com/falco-event-backend/pkg/database"
"github.com/falco-event-backend/pkg/gardenauth"
)

var landscapes = []string{"sap-landscape-dev", "sap-landscape-canary", "sap-landscape-live"}
Expand Down
3 changes: 2 additions & 1 deletion pkg/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import (
"testing"
"time"

"github.com/falco-event-backend/pkg/database"
"golang.org/x/time/rate"

"github.com/falco-event-backend/pkg/database"
)

func TestLandscapeToRegex(t *testing.T) {
Expand Down

0 comments on commit 4e1f430

Please sign in to comment.