Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add policy support to the chart #1094

Draft
wants to merge 37 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
df80f70
Updates for OpenFaaS IAM
alexellis Feb 20, 2023
821f778
Update temporary images
alexellis Mar 24, 2023
e9aa783
Update GW version
alexellis Mar 24, 2023
6375880
Rename openid_url env variable
welteki Mar 27, 2023
cf96d4f
Add oidc-plugin RBAC
welteki Mar 27, 2023
4ee2770
Add primary and system issuer template
alexellis Mar 27, 2023
551c266
Grant access to JwtIssuers to faas-netes
alexellis Mar 27, 2023
0ce6055
Remove base_host and openid_issuer from OIDC plugin
alexellis Mar 27, 2023
719905b
Add root-user policy for IAM
welteki Apr 5, 2023
c0335cb
Update oidc provider description
welteki Feb 14, 2023
8255432
Split Prometheus rules for OpenFaaS CE and Pro
alexellis Feb 14, 2023
8ff2995
Separate out licensed Pro Prometheus configs
alexellis Feb 14, 2023
c976ccd
Remove alertmanager from OpenFaaS Pro deployment
welteki Feb 16, 2023
3db4c0e
Add paremeter for signing key secret used by dashboard
welteki Feb 15, 2023
2f50573
Add dashboard warning message in openfaas chart notes
welteki Feb 16, 2023
236ae23
Update OpenFaaS Dashboard to make signing key optional
alexellis Feb 20, 2023
25a21ad
Bump golang.org/x/net from 0.0.0-20220624214902-1bab6f366d9e to 0.7.0
dependabot[bot] Feb 25, 2023
4b13921
Upgrades for Alpine base image and external dependencies
alexellis Feb 28, 2023
8fd7194
Remove basic-auth-plugin from chart
welteki Feb 28, 2023
85f1016
Remove basic auth plugin from chart for OpenFaaS Pro
alexellis Feb 28, 2023
cddb81a
Always mount license in autoscaler
welteki Feb 28, 2023
28b1e40
Bump actions/checkout from 2 to 3
dependabot[bot] Feb 28, 2023
acbffee
Bump actions/setup-go from 3.1.0 to 3.5.0
dependabot[bot] Feb 28, 2023
52948e7
Additional validation for OpenFaaS CE scaling
alexellis Mar 13, 2023
8283080
Update charts for queue-worker, function-builder and faas-netes CE
alexellis Mar 13, 2023
941b9a7
Enable safe handling of range limits for replicas
alexellis Mar 14, 2023
5faa794
Updates to OpenFaaS CE Chart
alexellis Mar 14, 2023
78f91b7
Add maxWaiting parameter for jetstream-queue-worker
welteki Feb 6, 2023
3a8b7f7
Bump openfaas/license-check from 0.4.1 to 0.4.2
dependabot[bot] Mar 16, 2023
abf646d
Bump actions/setup-go from 3.5.0 to 4.0.0
dependabot[bot] Mar 15, 2023
3b9492a
Bump docker/build-push-action from 3 to 4
dependabot[bot] Jan 31, 2023
f11cdb3
Bump azure/setup-helm from 1 to 3
dependabot[bot] Feb 28, 2023
cbbea2e
Update response message for invalid namespaces
welteki Apr 4, 2023
39869bc
Update pro-builder / buildkit and faas-netes
alexellis Apr 11, 2023
a09c858
Updates for openfaas dashboard
alexellis Apr 11, 2023
bbe0e72
Updates for OpenFaaS IAM
alexellis Feb 20, 2023
639ec94
Fix merge of gateway template
alexellis Apr 13, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: echo "GIT_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV

- name: Build x86_64 container into library
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
Expand All @@ -46,7 +46,7 @@ jobs:
ghcr.io/${{ env.REPO_OWNER }}/faas-netes:${{ github.sha }}

- name: Build multi-arch containers for validation only
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: azure/setup-helm@v1
uses: actions/checkout@v3
- uses: azure/setup-helm@v3
- name: Helm Lint
run: ./contrib/lint_chart.sh

Expand All @@ -30,7 +30,7 @@ jobs:
- lint-chart
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- uses: lra/setup-kubeval@v1
with:
version: v0.16.1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
- uses: actions/checkout@master
- name: Install Go
uses: actions/setup-go@v3.1.0
uses: actions/setup-go@v4.0.0
with:
go-version: 1.19.x
- name: Set up QEMU
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:


- name: Push containers
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ of_kind_portforward.pid
jwt_key
jwt_key.pub
/*.pid
*.txt
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/openfaas/license-check:0.4.1 as license-check
FROM ghcr.io/openfaas/license-check:0.4.2 as license-check

FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19 as build

Expand Down Expand Up @@ -27,7 +27,7 @@ RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \
--ldflags "-s -w \
-X github.com/openfaas/faas-netes/version.GitCommit=${GIT_COMMIT}\
-X github.com/openfaas/faas-netes/version.Version=${VERSION}" \
-a -installsuffix cgo -o faas-netes .
-o faas-netes .

FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.17 as ship
LABEL org.label-schema.license="MIT" \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ${CODEGEN_PKG}: $(TOOLS_DIR)/code-generator.mod
@cd $(TOOLS_DIR) && go mod download -modfile=code-generator.mod

local:
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o faas-netes
CGO_ENABLED=0 GOOS=linux go build -o faas-netes

build-docker:
docker build \
Expand Down
2 changes: 1 addition & 1 deletion chart/openfaas/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
type: application
description: OpenFaaS - Serverless Functions Made Simple
name: openfaas
version: 11.1.11
version: 12.0.4
sources:
- https://github.com/openfaas/faas
- https://github.com/openfaas/faas-netes
Expand Down
2 changes: 2 additions & 0 deletions chart/openfaas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ yaml) |
| ----------------------- | ---------------------------------- | ---------------------------------------------------------- |
| `jetstreamQueueWorker.durableName` | Durable name used by JetStream consumers | `faas-workers` |
| `jetstreamQueueWorker.image` | Container image used for the queue-worker when the `queueMode` is `jetstream` | See [values.yaml](./values.yaml) |
| `jetstreamQueueWorker.maxWaiting` | Configure the max waiting pulls for the queue-worker JetStream consumer. The value should be at least max_inflight * queue_worker.replicas. Note that this value can not be updated once the consumer is created. | `512` |
| `jetstreamQueueWorker.logs.debug` | Log debug messages | `false` |
| `jetstreamQueueWorker.logs.format` | Set the log format, supports `console` or `json` | `console` |
| `nats.channel` | The name of the NATS Streaming channel or NATS JetStream stream to use for asynchronous function invocations | `faas-request` |
Expand Down Expand Up @@ -546,6 +547,7 @@ yaml) |
| `dashboard.publicURL` | URL used to expose the dashboard. Needs to be a fully qualified domain name (FQDN) | `https://dashboard.example.com` |
| `dashboard.replicas` | Replicas of the dashboard | `1` |
| `dashboard.resources` | Resource limits and requests for the dashboard pods | See [values.yaml](./values.yaml) |
| `dashboard.signingKeySecret` | Name of signing key secret for sessions. Can be left blank for development, see https://docs.openfaas.com/openfaas-pro/dashboard/ for production and staging. | `""` |

### OIDC / SSO (OpenFaaS Pro)

Expand Down
6 changes: 6 additions & 0 deletions chart/openfaas/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ To retrieve the admin password, run:

echo $(kubectl -n {{ .Release.Namespace }} get secret basic-auth -o jsonpath="{.data.basic-auth-password}" | base64 --decode)
{{- end }}

{{- if and .Values.dashboard.enabled (not .Values.dashboard.signingKeySecret) }}

Warning: The dashboard is using auto generated signing keys.
These should only be used for development. See: https://docs.openfaas.com/openfaas-pro/dashboard/
{{- end}}
2 changes: 2 additions & 0 deletions chart/openfaas/templates/alertmanager-cfg.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- $functionNs := default .Release.Namespace .Values.functionNamespace }}
{{- if not .Values.openfaasPro }}
{{- if .Values.alertmanager.create }}
---
kind: ConfigMap
Expand Down Expand Up @@ -44,4 +45,5 @@ data:
username: admin
password_file: /var/secrets/basic-auth-password
{{- end -}}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions chart/openfaas/templates/alertmanager-dep.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- $functionNs := default .Release.Namespace .Values.functionNamespace }}
{{- if not .Values.openfaasPro }}
{{- if .Values.alertmanager.create }}
---
apiVersion: apps/v1
Expand Down Expand Up @@ -106,3 +107,4 @@ spec:
{{ toYaml . | indent 8 }}
{{- end }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions chart/openfaas/templates/alertmanager-svc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- $functionNs := default .Release.Namespace .Values.functionNamespace }}
{{- if not .Values.openfaasPro }}
{{- if .Values.alertmanager.create }}
---
apiVersion: v1
Expand All @@ -19,4 +20,5 @@ spec:
protocol: TCP
selector:
app: alertmanager
{{- end }}
{{- end }}
6 changes: 4 additions & 2 deletions chart/openfaas/templates/autoscaler-dep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,17 @@ spec:
value: "prometheus.{{ .Release.Namespace }}"
- name: prometheus_port
value: "9090"
{{- if .Values.basic_auth }}
- name: secret_mount_path
value: "/var/secrets/autoscaler"
{{- if .Values.basic_auth }}
- name: basic_auth
value: "{{ .Values.basic_auth }}"
value: "true"
{{- end }}
volumeMounts:
- name: license
readOnly: true
mountPath: "/var/secrets/license"
{{- if .Values.basic_auth }}
- name: auth
readOnly: true
mountPath: "/var/secrets/autoscaler"
Expand Down
108 changes: 0 additions & 108 deletions chart/openfaas/templates/basic-auth-plugin-dep.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions chart/openfaas/templates/basic-auth-plugin-svc.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions chart/openfaas/templates/controller-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ rules:
- "openfaas.com"
resources:
- "profiles"
- "policies"
verbs:
- "get"
- "list"
Expand Down Expand Up @@ -198,6 +199,7 @@ rules:
- "openfaas.com"
resources:
- "profiles"
- "policies"
verbs:
- "get"
- "list"
Expand Down
7 changes: 5 additions & 2 deletions chart/openfaas/templates/dashboard-dep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ spec:
- name: license
secret:
secretName: openfaas-license
{{- if .Values.dashboard.signingKeySecret }}
- name: dashboard-jwt
secret:
secretName: dashboard-jwt
secretName: {{ .Values.dashboard.signingKeySecret }}
{{- end }}
containers:
- name: dashboard
resources:
Expand Down Expand Up @@ -79,13 +81,14 @@ spec:
readOnly: true
mountPath: "/var/secrets/gateway"
{{- end }}

- name: license
readOnly: true
mountPath: "/var/secrets/license"
{{- if .Values.dashboard.signingKeySecret }}
- name: dashboard-jwt
readOnly: true
mountPath: "/var/secrets/dashboard-jwt"
{{- end }}

{{- with .Values.nodeSelector }}
nodeSelector:
Expand Down
Loading