diff --git a/litmus-portal/cluster-k8s-manifest.yml b/litmus-portal/cluster-k8s-manifest.yml index a92e3b669f4..38645d96450 100644 --- a/litmus-portal/cluster-k8s-manifest.yml +++ b/litmus-portal/cluster-k8s-manifest.yml @@ -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://:32000" + DEX_OAUTH_CALLBACK_URL: "http://:8080/auth/dex/callback" + DEX_OAUTH_CLIENT_ID: "LitmusPortalAuthBackend" + DEX_OAUTH_CLIENT_SECRET: "ZXhhbXBsZS1hcHAtc2VjcmV0" + OAuthJwtSecret: "litmus-oauth@123" --- apiVersion: v1 kind: ConfigMap diff --git a/litmus-portal/dex-server/dex-deployment.yaml b/litmus-portal/dex-server/dex-deployment.yaml new file mode 100644 index 00000000000..4c8409ab895 --- /dev/null +++ b/litmus-portal/dex-server/dex-deployment.yaml @@ -0,0 +1,103 @@ +# ConfigMap for DexServer +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: dex-server-admin-config + namespace: litmus +data: + config.yaml: | + issuer: http://: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://: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://: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 +