diff --git a/helmchart/offline/cronjob-recreate-oauth-clients.yaml b/helmchart/offline/cronjob-recreate-oauth-clients.yaml deleted file mode 100644 index 286651b8098b551274f13526c3d31329b049183e..0000000000000000000000000000000000000000 --- a/helmchart/offline/cronjob-recreate-oauth-clients.yaml +++ /dev/null @@ -1,91 +0,0 @@ -apiVersion: batch/v1 -kind: CronJob -metadata: - name: {{ include "single-sign-on.fullname" . }}-recreate-oauth2-clients - labels: -{{ include "single-sign-on.labels" . | indent 4 }} -spec: - schedule: "*/5 * * * *" - jobTemplate: - metadata: - labels: - app.kubernetes.io/managed-by: {{.Release.Service | quote }} - app.kubernetes.io/instance: {{.Release.Name | quote }} - helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}" - spec: - template: - spec: - restartPolicy: Never - containers: - {{- range .Values.oAuthClients }} - - name: {{ .clientName | quote }} - image: {{ $.Values.userbackend.image.repository }}:{{ $.Values.userbackend.image.tag }} - imagePullPolicy: {{ $.Values.userbackend.image.pullPolicy }} - env: - - name: CLIENT_ID - valueFrom: - secretKeyRef: - name: oauth2-clients - key: {{ .clientName }}_client_id - - name: CLIENT_SECRET - valueFrom: - secretKeyRef: - name: oauth2-clients - key: {{ .clientName }}_client_secret - - name: CLIENT_NAME - value: {{ .clientName | quote }} - - name: REDIRECT_URI - value: {{ .redirectUri | quote }} - - name: SCOPES - value: {{ .scopes | quote }} - - name: CLIENT_URI - value: {{ .clientUri | quote }} - - name: CLIENT_LOGO_URI - value: {{ .clientLogoUri | quote }} - - name: TOKEN_ENDPOINT_AUTH_METHOD - value: {{ .tokenEndpointAuthMethod | quote }} - - name: RESPONSE_TYPES - value: "{{- range .responseTypes }}\"{{ . }}\",{{- end }}" - - name: GRANT_TYPES - value: "{{- range .grantTypes }}\"{{ . }}\",{{- end }}" - command: ["/bin/bash", "-c"] - args: - - | - curl http://{{ $.Release.Name }}-hydra-admin:4445/health/ready \ - --silent \ - --write-out "\nCheck Hydra health: HTTP %{http_code}" \ - | tail -1 | grep 200; \ - if [ $? -eq 0 ]; then \ - echo "Hydra is ready to accept requests."; \ - curl http://{{ $.Release.Name }}-hydra-admin:4445/clients/$CLIENT_NAME \ - --silent \ - --write-out "\nRequesting oauth client $CLIENT_NAME: HTTP %{http_code}\n" \ - | tail -1 \ - | grep 401; \ - if [ $? -eq 0 ]; then \ - echo "Client doesn't exist. (Re)creating client..."; \ - curl --header "Content-Type: application/json" \ - --request POST \ - --data "{\"client_id\": \"$CLIENT_ID\", - \"client_name\": \"$CLIENT_NAME\", - \"client_secret\": \"$CLIENT_SECRET\", - \"client_uri\": \"$CLIENT_URI\", - \"logo_uri\": \"$CLIENT_LOGO_URI\", - \"redirect_uris\": [\"$REDIRECT_URI\"], - \"scope\": \"$SCOPES\", - \"grant_types\": [$GRANT_TYPES\"\"], - \"response_types\": [$RESPONSE_TYPES\"\"], - \"token_endpoint_auth_method\": \"client_secret_post\"}" \ - http://{{ $.Release.Name }}-hydra-admin:4445/clients \ - --silent \ - --write-out "\nCreating oauth client $CLIENT_ID: HTTP(%{http_code})\n" \ - | tail -1 \ - | grep 201; \ - if [ $? -eq 0 ]; then echo "Successfully created $CLIENT_ID"; exit 0; \ - else echo "Client creation failed"; exit 1; \ - fi; \ - else echo "Client already exists"; exit 0; \ - fi; \ - else echo "Hydra API not available"; exit 1; \ - fi; - {{- end }} diff --git a/helmchart/offline/deployment-consent.yaml b/helmchart/offline/deployment-consent.yaml deleted file mode 100644 index 51bd29d4a8b00334a54458cf8db387700bea21e7..0000000000000000000000000000000000000000 --- a/helmchart/offline/deployment-consent.yaml +++ /dev/null @@ -1,31 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "single-sign-on.fullname" . }}-consent - labels: - {{- include "single-sign-on.labels" . | nindent 4 }} -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/name: {{ include "single-sign-on.name" . }}-consent - template: - metadata: - labels: - app.kubernetes.io/name: {{ include "single-sign-on.name" . }}-consent - annotations: - {{- toYaml .Values.consentProvider.podAnnotations | nindent 8 }} - spec: - containers: - - name: {{ .Chart.Name }}-consent - image: {{ .Values.consentProvider.image.repository }}:{{ .Values.consentProvider.image.tag }} - imagePullPolicy: {{ .Values.consentProvider.image.pullPolicy }} - env: - - name: HYDRA_ADMIN_URL - value: http://{{ .Release.Name }}-hydra-admin:4445 - - name: GRAPHQL_URL - value: http://{{ include "single-sign-on.fullname" . }}-userbackend/graphql - ports: - - name: consent-http - containerPort: 5001 - protocol: TCP diff --git a/helmchart/offline/deployment-userbackend.yaml b/helmchart/offline/deployment-userbackend.yaml deleted file mode 100644 index 46a555eadc58d09060a16197b14626a2bb6fb062..0000000000000000000000000000000000000000 --- a/helmchart/offline/deployment-userbackend.yaml +++ /dev/null @@ -1,60 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "single-sign-on.fullname" . }}-userbackend - labels: - {{- include "single-sign-on.labels" . | nindent 4 }} - {{- if .Values.userbackend.deploymentLabels }} - {{- toYaml .Values.userbackend.deploymentLabels | nindent 4 }} - {{- end }} -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/name: {{ include "single-sign-on.name" . }}-userbackend - template: - metadata: - labels: - app.kubernetes.io/name: {{ include "single-sign-on.name" . }}-userbackend - {{- if .Values.userbackend.podLabels }} - {{- toYaml .Values.userbackend.podLabels | nindent 8 }} - {{- end }} - annotations: - {{- toYaml .Values.userbackend.podAnnotations | nindent 8 }} - spec: - containers: - - name: {{ .Chart.Name }}-userbackend-db - image: {{ .Values.userbackend.postgres.image.repository }}:{{ .Values.userbackend.postgres.image.tag }} - imagePullPolicy: {{ .Values.userbackend.postgres.image.pullPolicy }} - env: - - name: POSTGRES_PASSWORD - value: {{ .Values.userbackend.postgres.password }} - volumeMounts: - - name: database - mountPath: /var/lib/postgresql/data - - name: {{ .Chart.Name }}-userbackend-api - image: {{ .Values.userbackend.image.repository }}:{{ .Values.userbackend.image.tag }} - imagePullPolicy: {{ .Values.userbackend.image.pullPolicy }} - env: - - name: HYDRA_ADMIN_URL - value: http://{{ include "single-sign-on.name" . }}-hydra-admin:4445 - - name: DATABASE_USER - value: "postgres" - - name: DATABASE_PASSWORD - value: {{ default .Values.userbackend.postgres.password }} - - name: DATABASE_NAME - value: "postgres" - - name: DATABASE_HOST - value: "localhost" - ports: - - name: userbackend - containerPort: 5000 - protocol: TCP - volumes: - - name: database - {{- if .Values.userbackend.persistence.enabled }} - persistentVolumeClaim: - claimName: {{ if .Values.userbackend.persistence.existingClaim }}{{ .Values.userbackend.persistence.existingClaim }}{{- else }}{{ include "single-sign-on.fullname" . }}-userbackend{{- end }} - {{- else }} - emptyDir: {} - {{- end }} diff --git a/helmchart/offline/deployment-userfrontend.yaml b/helmchart/offline/deployment-userfrontend.yaml deleted file mode 100644 index 1bb6a9c6d241706db6f68495dedaaec961466c2a..0000000000000000000000000000000000000000 --- a/helmchart/offline/deployment-userfrontend.yaml +++ /dev/null @@ -1,53 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "single-sign-on.fullname" . }}-userpanel - labels: -{{ include "single-sign-on.labels" . | indent 4 }} -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/name: {{ include "single-sign-on.name" . }}-userpanel - template: - metadata: - labels: - app.kubernetes.io/name: {{ include "single-sign-on.name" . }}-userpanel - annotations: - {{- toYaml .Values.userpanel.podAnnotations | nindent 8 }} - spec: - containers: - - name: {{ .Chart.Name }}-userpanel - image: {{ .Values.userpanel.image.repository }}:{{ .Values.userpanel.image.tag }} - imagePullPolicy: {{ .Values.userpanel.image.pullPolicy }} - env: - - name: HOST - value: 0.0.0.0 - - name: BASE_URL - value: https://{{ .Values.userpanel.ingress.host }} - - name: REDIRECT_URL - value: https://{{ .Values.userpanel.ingress.host }}/callback - - name: HYDRA_BASE_URL - value: {{ .Values.hydra.hydra.config.urls.self.issuer }} - - name: AUTHORIZE_URL - value: {{ .Values.hydra.hydra.config.urls.self.issuer }}/oauth2/auth - - name: USERINFO_URL - value: {{ .Values.hydra.hydra.config.urls.self.issuer }}/userinfo - - name: ACCESS_TOKEN - value: {{ .Values.hydra.hydra.config.urls.self.issuer }}/oauth2/token - - name: BACKEND_API_URL - value: http://{{ include "single-sign-on.fullname" . }}-userbackend/graphql - - name: OAUTH_CLIENT_ID - valueFrom: - secretKeyRef: - name: oauth2-clients - key: {{ .Values.userpanel.applicationName }}_client_id - - name: OAUTH_CLIENT_SECRET - valueFrom: - secretKeyRef: - name: oauth2-clients - key: {{ .Values.userpanel.applicationName }}_client_secret - ports: - - name: userpanel - containerPort: 3000 - protocol: TCP diff --git a/helmchart/offline/job-create-admin-user.yaml b/helmchart/offline/job-create-admin-user.yaml deleted file mode 100644 index ccaec5f91106300399f0d6c0f63d28ee3fe1632e..0000000000000000000000000000000000000000 --- a/helmchart/offline/job-create-admin-user.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: {{ include "single-sign-on.fullname" . }}-create-admin-user - labels: -{{ include "single-sign-on.labels" . | indent 4 }} - annotations: - "helm.sh/hook": post-install,post-upgrade - "helm.sh/hook-weight": "-5" - "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded -spec: - template: - metadata: - labels: - app.kubernetes.io/managed-by: {{.Release.Service | quote }} - app.kubernetes.io/instance: {{.Release.Name | quote }} - helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}" - spec: - restartPolicy: Never - containers: - - name: create-admin-user - image: {{ .Values.userbackend.image.repository }}:{{ .Values.userbackend.image.tag }} - imagePullPolicy: {{ .Values.userbackend.image.pullPolicy }} - env: - - name: USERNAME - value: {{ .Values.userbackend.username }} - - name: PASSWORD - value: {{ .Values.userbackend.password }} - - name: EMAIL - value: {{ .Values.userbackend.email }} - command: ["/bin/bash", "-c"] - args: - - /bin/bash ./utils/create-user.bash "$USERNAME" "$PASSWORD" "$EMAIL" http://{{ include "single-sign-on.fullname" . }}-userbackend:80 && - {{- range .Values.userbackend.applications }} - /bin/bash ./utils/create-application.bash {{ .name }} '{{ .description | default " " }}' http://{{ include "single-sign-on.fullname" $ }}-userbackend:80 && - /bin/bash ./utils/grant-access.bash "$USERNAME" {{ .name }} http://{{ include "single-sign-on.fullname" $ }}-userbackend:80 && - {{- end }} - /bin/bash ./utils/create-role.bash admin http://{{ include "single-sign-on.fullname" . }}-userbackend:80 && - /bin/bash ./utils/assign-role.bash "$USERNAME" admin http://{{ include "single-sign-on.fullname" . }}-userbackend:80 diff --git a/helmchart/offline/service-consent.yaml b/helmchart/offline/service-consent.yaml deleted file mode 100644 index 74bb0ca254a4d0f1fd02aa7f2216d7f0ffac3db6..0000000000000000000000000000000000000000 --- a/helmchart/offline/service-consent.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "single-sign-on.fullname" . }}-consent - labels: -{{ include "single-sign-on.labels" . | indent 4 }} -spec: - ports: - - port: 5001 - targetPort: consent-http - protocol: TCP - name: consent-http - selector: - app.kubernetes.io/name: {{ include "single-sign-on.name" . }}-consent diff --git a/helmchart/offline/service-userbackend.yaml b/helmchart/offline/service-userbackend.yaml deleted file mode 100644 index 1401afd9ef46b60b4c08e1b572f99cd314f65ca4..0000000000000000000000000000000000000000 --- a/helmchart/offline/service-userbackend.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "single-sign-on.fullname" . }}-userbackend - labels: -{{ include "single-sign-on.labels" . | indent 4 }} -spec: - ports: - - port: 80 - targetPort: userbackend - protocol: TCP - name: userbackend - selector: - app.kubernetes.io/name: {{ include "single-sign-on.name" . }}-userbackend diff --git a/helmchart/offline/service-userfrontend.yaml b/helmchart/offline/service-userfrontend.yaml deleted file mode 100644 index 0dc90890884bddf613807a0964e0c3eda21ee20d..0000000000000000000000000000000000000000 --- a/helmchart/offline/service-userfrontend.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "single-sign-on.fullname" . }}-userpanel - labels: -{{ include "single-sign-on.labels" . | indent 4 }} -spec: - ports: - - port: 3000 - targetPort: userpanel - protocol: TCP - name: userpanel - selector: - app.kubernetes.io/name: {{ include "single-sign-on.name" . }}-userpanel