Skip to content

Commit

Permalink
Fix external ingress (#1101)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljguarino committed Jun 24, 2024
1 parent 452af72 commit 2c13fb3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 42 deletions.
2 changes: 2 additions & 0 deletions assets/src/generated/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,8 @@ export type CloudSettingsAttributes = {
/** a representation of a cluster you can deploy to */
export type Cluster = {
__typename?: 'Cluster';
/** the url this clusters deployment operator will use for gql requests */
agentUrl?: Maybe<Scalars['String']['output']>;
/** all api deprecations for all services in this cluster */
apiDeprecations?: Maybe<Array<Maybe<ApiDeprecation>>>;
/** a custom credential to use when provisioning this cluster */
Expand Down
42 changes: 0 additions & 42 deletions charts/console/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@ spec:
- host: {{ .Values.ingress.console_dns | quote }}
http:
paths:
{{ if not .Values.ingress.rewrite.enabled }}
- path: /ext/kas
pathType: Prefix
backend:
service:
name: console-kas-service
port:
number: 8180
{{ end }}
{{ if .Values.dashboard.enabled }}
- path: /api
pathType: Prefix
Expand Down Expand Up @@ -96,9 +94,6 @@ metadata:
labels:
{{ include "console.labels" . | indent 4 }}
annotations:
{{- with .Values.externalIngress.rewrite.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.externalIngress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
Expand All @@ -114,55 +109,18 @@ spec:
- host: {{ .Values.externalIngress.hostname | quote }}
http:
paths:
{{ if not .Values.ingress.rewrite.enabled }}
- path: /ext/kas
pathType: Prefix
backend:
service:
name: console-kas-service
port:
number: 8180
{{ end }}
- path: /ext
pathType: Prefix
backend:
service:
name: console
port:
name: http
{{ if .Values.ingress.rewrite.enabled }}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: console-ext-kas-rewrite
labels:
{{ include "console.labels" . | indent 4 }}
annotations:
{{- with .Values.externalIngress.rewrite.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.externalIngress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ingressClassName: {{ .Values.externalIngress.ingressClass }}
{{ if .Values.externalIngress.tls.enabled }}
tls:
- hosts:
- {{ .Values.externalIngress.hostname | quote }}
secretName: console-external-tls
{{ end }}
rules:
- host: {{ .Values.externalIngress.hostname | quote }}
http:
paths:
- path: /ext/kas
pathType: ImplementationSpecific
backend:
service:
name: console-kas-service
port:
number: 8150
{{ end }}
{{ end }}
5 changes: 5 additions & 0 deletions lib/console/graphql/deployments/cluster.ex
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,15 @@ defmodule Console.GraphQl.Deployments.Cluster do
field :installed, :boolean, description: "whether the deploy operator has been registered for this cluster"
field :settings, :cloud_settings, description: "the cloud settings for this cluster (for instance its aws region)"
field :upgrade_plan, :cluster_upgrade_plan, description: "Checklist of tasks to complete to safely upgrade this cluster"

field :kas_url, :string, description: "the url of the kas server you can access this cluster from", resolve: fn
_, _, _ -> {:ok, Console.Deployments.Clusters.kas_proxy_url()}
end

field :agent_url, :string,
description: "the url this clusters deployment operator will use for gql requests",
resolve: fn _, _, _ -> {:ok, Console.Deployments.Services.api_url("gql")} end

field :deploy_token, :string,
description: "a auth token to be used by the deploy operator, only readable on create",
resolve: &Deployments.deploy_token/3
Expand Down
3 changes: 3 additions & 0 deletions schema/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3494,6 +3494,9 @@ type Cluster {
"the url of the kas server you can access this cluster from"
kasUrl: String

"the url this clusters deployment operator will use for gql requests"
agentUrl: String

"a auth token to be used by the deploy operator, only readable on create"
deployToken: String

Expand Down

0 comments on commit 2c13fb3

Please sign in to comment.