generated from fluxcd/flux2-kustomize-helm-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
94 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
OAUTH2_PROXY_COOKIE_SECRET=CONFIGUREME | ||
OAUTH2_PROXY_CLIENT_SECRET=CONFIGUREME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.oauth2-secret.env | ||
oauth2-proxy-dagster-secrets.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: oauth2-dagster-proxy-config | ||
namespace: dagster | ||
data: | ||
OAUTH2_PROXY_PROVIDER: keycloak-oidc | ||
OAUTH2_PROXY_CLIENT_ID: dagster-webserver | ||
OAUTH2_PROXY_REDIRECT_URL: https://dagster.local.reinthal.cc/oauth2/callback | ||
OAUTH2_PROXY_OIDC_ISSUER_URL: https://keycloak.local.reinthal.cc/auth/realms/reinthal | ||
OAUTH2_PROXY_EMAIL_DOMAINS: reinthal.me | ||
OAUTH2_PROXY_ALLOWED_ROLES: dagster-operator | ||
OAUTH2_PROXY_CODE_CHALLENGE_METHOD: S256 | ||
OAUTH2_PROXY_UPSTREAMS: "http://dagster-dagster-webserver.dagster.svc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
apiVersion: source.toolkit.fluxcd.io/v1beta2 | ||
kind: HelmRepository | ||
metadata: | ||
name: oauth2-proxy | ||
namespace: dagster | ||
spec: | ||
interval: 1m0s | ||
url: https://oauth2-proxy.github.io/manifests | ||
--- | ||
apiVersion: helm.toolkit.fluxcd.io/v2beta2 | ||
kind: HelmRelease | ||
metadata: | ||
name: oauth2-proxy | ||
namespace: dagster | ||
spec: | ||
chart: | ||
spec: | ||
chart: oauth2-proxy | ||
reconcileStrategy: ChartVersion | ||
sourceRef: | ||
kind: HelmRepository | ||
name: oauth2-proxy | ||
namespace: dagster | ||
version: 7.8.0 | ||
install: | ||
createNamespace: false | ||
interval: 1m0s | ||
releaseName: oauth2-dagster-webui-proxy | ||
targetNamespace: dagster | ||
values: | ||
|
||
config: | ||
|
||
existingSecret: oauth2-proxy-secrets | ||
existingConfig: oauth2-dagster-proxy-config | ||
|
||
image: | ||
pullPolicy: IfNotPresent | ||
repository: quay.io/oauth2-proxy/oauth2-proxy | ||
tag: "v7.7.1" | ||
kubeVersion: null | ||
namespaceOverride: "" | ||
replicaCount: 2 | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 300Mi | ||
requests: | ||
cpu: 100m | ||
memory: 300Mi |
16 changes: 16 additions & 0 deletions
16
apps/base/dagster/oauth2-proxy-dagster-secrets-sealed.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
apiVersion: bitnami.com/v1alpha1 | ||
kind: SealedSecret | ||
metadata: | ||
creationTim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JP036zz+3YCrUXDSdJMKfFVXQcgGVhZjohQXta2yg07E5vQugS2uj0kKCtoi4l+FMFoupgVwRkXgzVXm7g7ZHKpQYU1olGvvmHrGqF6iKYUIE+W1CzidPaQUXehqQokRlERw/S3t0wRzlIKGhP1oDrOw7/2MPRBbkj6myRY4zrVRzrksLuzDlUlRVjoKBJskgwlMkHLJTcQVa6WTNNMTFfJcpI9pZ+meFYO99WMZCb844PZwy4RFjgT5K64z5HM8NC/g61pM/P/U4QsPGp80vBs4+T3J8Gqs/RCx6DaMUKI7RaKaXjr8FPP4xPar9N4imX5AgqnBaKiOMRNcV+rIXbESh1WjDbSdKtSNZg3kJyvaJU5opE12yd/eZ3IqW0ZMUyBhSi9VXyLrMPrsrIwK23uneopoL5W0jtZBQpsUIa7jXU3VRMeatFk6Qp4Rel7iW8c2woVZMrdjafvCXcMv987fsGIHxeilhYcrXlSjCwa1+3+9bhX6/a2mewEYW7fTWuTdvM1gHQ2Wb6Y+PTijByn2oN8qWIV3Q8i3/ZxeMFdtWUytPMhUm1aA== | ||
template: | ||
metadata: | ||
creationTimestamp: null | ||
name: oauth2-proxy-secrets | ||
namespace: dagster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,29 @@ | ||
# Oauth2 Proxy | ||
|
||
## Generating a Cookie Secret | ||
|
||
```bash | ||
python -c 'import os,base64; print(base64.urlsafe_b64encode(os.urandom(32)).decode())' | ||
``` | ||
|
||
## Generating the Client Secret | ||
|
||
TODO | ||
|
||
## Generating the sealed secret | ||
|
||
```bash | ||
cp .env.example.oauth2-proxy .oauth2-secret.env | ||
``` | ||
|
||
Perform the above steps and put the secrets in `.oauth2-secret.env`. Then perform the below command. | ||
|
||
```bash | ||
kubectl create secret generic oauth2-proxy-secrets \ | ||
-n dagster --from-env-file=.oauth2-secret.env -o yaml \ | ||
--dry-run | tee oauth2-secret.yaml | \ | ||
--dry-run | tee oauth2-proxy-dagster-secrets.yaml | \ | ||
kubeseal --format=yaml --cert=../../../keys/pub-sealed-secrets.pem | \ | ||
tee snowflake-secrets-sealed.yaml | ||
tee oauth2-proxy-dagster-secrets-sealed.yaml | ||
``` | ||
|
||
Commit changes and push using `deploy` script. |