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

area(litmusportal/dex-integration): add dex-deployment to litmus-portal infra #3265

Merged
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
7 changes: 7 additions & 0 deletions litmus-portal/cluster-k8s-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,13 @@ data:
DB_USER: "admin"
DB_PASSWORD: "1234"
VERSION: "ci"
# Configurations if you are using dex for OAuth
DEX_ENABLED: "false"
OIDC_ISSUER: "http://<Your Domain>:32000"
DEX_OAUTH_CALLBACK_URL: "http://<litmus-portal frontend exposed URL>:8080/auth/dex/callback"
DEX_OAUTH_CLIENT_ID: "LitmusPortalAuthBackend"
DEX_OAUTH_CLIENT_SECRET: "ZXhhbXBsZS1hcHAtc2VjcmV0"
OAuthJwtSecret: "litmus-oauth@123"
---
apiVersion: v1
kind: ConfigMap
Expand Down
103 changes: 103 additions & 0 deletions litmus-portal/dex-server/dex-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# ConfigMap for DexServer
---
apiVersion: v1
kind: ConfigMap
metadata:
name: dex-server-admin-config
namespace: litmus
data:
config.yaml: |
issuer: http://<Your Domain>:32000 # Replace your domain here

storage:
type: kubernetes
config:
inCluster: true

web:
http: 0.0.0.0:5556

staticClients:
- id: LitmusPortalAuthBackend
redirectURIs:
- '/auth/dex/callback'
- 'http://localhost:8080/auth/dex/callback' # Included for local testing purposes
name: 'LitmusPortalAuthBackend'
secret: ZXhhbXBsZS1hcHAtc2VjcmV0

oauth2:
skipApprovalScreen: true

connectors:
- type: google
id: google
name: Google
config:
clientID: # Add your Google Client ID here
clientSecret: # Add your Google Client Secret here
redirectURI: http://<Your Domain>:32000 # Replace your domain here

- type: github
id: github
name: GitHub
config:
clientID: # Add your GitHub Client ID here
clientSecret: # Add your GitHub Client Secret here
redirectURI: http://<Your Domain>:32000/callback # Replace your domain here

---
# ClusterRole for DexServer
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: litmus-dex-server
rules:
- apiGroups: [dex.coreos.com]
resources:
[
authcodes,
authrequests,
connectors,
devicerequests,
connectors,
devicerequests,
devicetokens,
oauth2clients,
oflinesessionses,
passwords,
refreshtokens,
signingkeies,
]
verbs: [delete, deletecollection, get, list, patch, create, update, watch]
---
# ClusterRoleBinding for DexServer
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: litmus-dex-server-crb
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: litmus-dex-server
subjects:
- kind: ServiceAccount
name: litmus-server-account
namespace: litmus
---
# Exposed service for DexServer
apiVersion: v1
kind: Service
metadata:
name: litmusportal-dex-service
namespace: litmus
spec:
type: NodePort
ports:
- name: dex-server
port: 80
protocol: TCP
targetPort: 5556
nodePort: 32000
selector:
component: litmusportal-dex-server