Skip to content

Commit fe80010

Browse files
authored
chore: remove code for ingress-nginx app configuration (#994)
* chore: remove code for ingress-nginx app configuration * chore: sync app info with core
1 parent 1383046 commit fe80010

7 files changed

Lines changed: 13 additions & 201 deletions

File tree

src/app.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,7 @@ export const getSpec = (): OtomiSpec => {
129129
return otomiSpec
130130
}
131131
export const getAppSchema = (appId: string): Schema => {
132-
let id: string = appId
133-
if (appId.startsWith('ingress-nginx')) id = 'ingress-nginx-platform'
134-
return getSpec().valuesSchema.properties.apps.properties[id]
132+
return getSpec().valuesSchema.properties.apps.properties[appId]
135133
}
136134

137135
export const getAppList = (): string[] => {

src/openapi/app.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ AppList:
1212
- gitea
1313
- grafana
1414
- harbor
15-
- ingress-nginx
1615
- istio
1716
- keycloak
1817
- knative

src/otomi-stack.ts

Lines changed: 3 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ import {
9999
EDITOR_INACTIVITY_TIMEOUT,
100100
GIT_BRANCH,
101101
GIT_EMAIL,
102+
GIT_INIT_MAX_RETRIES,
103+
GIT_INIT_RETRY_INTERVAL_MS,
102104
GIT_LOCAL_PATH,
103105
GIT_PASSWORD,
104106
GIT_REPO_URL,
@@ -111,8 +113,6 @@ import {
111113
PREINSTALLED_EXCLUDED_APPS,
112114
TOOLS_HOST,
113115
VERSIONS,
114-
GIT_INIT_MAX_RETRIES,
115-
GIT_INIT_RETRY_INTERVAL_MS,
116116
} from 'src/validators'
117117
import { v4 as uuidv4 } from 'uuid'
118118
import { parse as parseYaml, stringify as stringifyYaml } from 'yaml'
@@ -278,12 +278,7 @@ export default class OtomiStack {
278278
}
279279

280280
async getAppList() {
281-
let apps = getAppList()
282-
apps = apps.filter((item) => item !== 'ingress-nginx')
283-
const { ingress } = await this.getSettings()
284-
const allClasses = ['platform'].concat(ingress?.classes?.map((obj) => obj.className as string) || [])
285-
const ingressApps = allClasses.map((name) => `ingress-nginx-${name}`)
286-
return apps.concat(ingressApps)
281+
return getAppList()
287282
}
288283

289284
async getValues(query): Promise<Record<string, any>> {
@@ -607,62 +602,8 @@ export default class OtomiStack {
607602
}
608603
}
609604

610-
async loadIngressApps(id: string): Promise<void> {
611-
try {
612-
debug(`Loading ingress apps for ${id}`)
613-
const content = await this.git.loadConfig('env/apps/ingress-nginx.yaml', 'env/apps/secrets.ingress-nginx.yaml')
614-
const values = content?.apps?.['ingress-nginx'] ?? {}
615-
616-
const filePath = getResourceFilePath('AplApp', id)
617-
const aplApp = toPlatformObject('AplApp', id, { enabled: true, rawValues: {}, ...values })
618-
this.fileStore.set(filePath, aplApp)
619-
620-
debug(`Ingress app loaded for ${id}`)
621-
} catch (error) {
622-
debug(`Failed to load ingress apps for ${id}:`)
623-
}
624-
}
625-
626-
async removeIngressApps(id: string): Promise<void> {
627-
try {
628-
debug(`Removing ingress apps for ${id}`)
629-
const filePath = `env/apps/${id}.yaml`
630-
const secretsPath = `env/apps/secrets.${id}.yaml`
631-
632-
this.fileStore.delete(filePath)
633-
await this.git.removeFile(filePath)
634-
await this.git.removeFile(secretsPath)
635-
debug(`Ingress app removed for ${id}`)
636-
} catch (error) {
637-
debug(`Failed to remove ingress app for ${id}:`)
638-
}
639-
}
640-
641-
async editIngressApps(settings: Settings, data: Settings, settingId: string): Promise<void> {
642-
if (settingId !== 'ingress') return
643-
const initClasses = settings[settingId]?.classes || []
644-
const initClassNames = initClasses.map((obj) => obj.className)
645-
const dataClasses = data[settingId]?.classes || []
646-
const dataClassNames = dataClasses.map((obj) => obj.className)
647-
// Ingress app addition
648-
for (const ingressClass of dataClasses) {
649-
if (!initClassNames.includes(ingressClass.className)) {
650-
const id = `ingress-nginx-${ingressClass.className}`
651-
await this.loadIngressApps(id)
652-
}
653-
}
654-
// Ingress app deletion
655-
for (const ingressClass of initClasses) {
656-
if (!dataClassNames.includes(ingressClass.className)) {
657-
const id = `ingress-nginx-${ingressClass.className}`
658-
await this.removeIngressApps(id)
659-
}
660-
}
661-
}
662-
663605
async editSettings(data: Settings, settingId: string): Promise<Settings> {
664606
const settings = await this.getSettings()
665-
await this.editIngressApps(settings, data, settingId)
666607
const updatedSettingsData: any = { ...data }
667608
if (settingId === 'otomi') {
668609
// convert otomi.nodeSelector to object

src/validators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export const PREINSTALLED_EXCLUDED_APPS = json({
9393
export const HIDDEN_APPS = json({
9494
desc: 'Applications that are hidden from the apps page',
9595
default: {
96-
apps: ['ingress-nginx-platform'],
96+
apps: [],
9797
},
9898
})
9999
export const OBJ_STORAGE_APPS = json({

test/apps.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,6 @@ appsInfo:
8585
dependencies: None
8686
about: Harbor is an open source trusted cloud native registry project that stores, signs, and scans content. Harbor extends the open source Docker Distribution by adding the functionalities usually required by users such as security, identity and management. Having a registry closer to the build and run environment can improve the image transfer efficiency. Harbor supports replication of images between registries, and also offers advanced security features such as user management, access control and activity auditing.
8787
integration: Harbor can be enabled to provide each team with a private registry. Harbor has been made user and tenant aware. APL runs automated tasks that take care of creating a project in Harbor for each team, creating a bot-account for each team, and creating a Kubernetes pull secret in the team namespace to enable pulling of images out of the local registry.
88-
ingress-nginx:
89-
title: Ingress-NGINX
90-
appVersion: 1.13.1
91-
repo: https://github.com/kubernetes/ingress-nginx
92-
maintainers: NGINX
93-
relatedLinks:
94-
- https://docs.nginx.com/nginx-ingress-controller
95-
license: Apache 2.0
96-
about: ingress-nginx is an Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer.
97-
integration: APL integrated ingress-nginx into an advanced ingress architecture.
9888
istio:
9989
title: Istio
10090
appVersion: 1.26.3

test/core.yaml

Lines changed: 8 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ k8s:
1919
app: harbor
2020
- name: apl-harbor-operator
2121
disableIstioInjection: true
22+
- name: git-server
2223
- name: gitea
2324
- name: apl-gitea-operator
2425
disableIstioInjection: true
@@ -28,14 +29,6 @@ k8s:
2829
app: grafana
2930
- name: istio-system
3031
disableIstioInjection: true
31-
labels:
32-
'apl.io/ingress-controller-scope': 'true'
33-
- name: ingress
34-
# disabling istio sidecar as it does not preserve client ip (yet)
35-
# TODO: enable once it does
36-
disableIstioInjection: true
37-
labels:
38-
'apl.io/ingress-controller-scope': 'true'
3932
- name: keycloak
4033
- name: apl-keycloak-operator
4134
disableIstioInjection: true
@@ -58,6 +51,8 @@ k8s:
5851
- name: kyverno
5952
app: kyverno
6053
disableIstioInjection: true
54+
- name: tekton-dashboard
55+
app: tekton-pipelines
6156
- name: tekton-pipelines
6257
disableIstioInjection: true
6358
disablePolicyChecks: true
@@ -87,6 +82,11 @@ k8s:
8782
disablePolicyChecks: true
8883
- name: sealed-secrets
8984
app: sealed-secrets
85+
- name: external-secrets
86+
app: external-secrets
87+
disableIstioInjection: true
88+
- name: apl-secrets
89+
disableIstioInjection: true
9090
- name: policy-reporter
9191
app: policy-reporter
9292
disablePolicyChecks: true
@@ -97,22 +97,10 @@ adminApps:
9797
tags: [alerting, observability]
9898
deps: [prometheus]
9999
ownHost: true
100-
ingress:
101-
- svc: po-alertmanager
102-
namespace: monitoring
103-
# namespace: alertmanager
104-
port: 9093
105-
type: public
106-
auth: true
107100
- name: argocd
108101
tags: [cicd, gitops]
109102
isShared: true
110103
ownHost: true
111-
ingress:
112-
- svc: argocd-server
113-
namespace: argocd
114-
type: public
115-
auth: true
116104
- name: cert-manager
117105
tags: [ingress, security, tls]
118106
- name: cnpg
@@ -121,101 +109,44 @@ adminApps:
121109
tags: [tty]
122110
isShared: true
123111
ownHost: true
124-
ingress:
125-
- svc: tty
126-
# virtual service is not going to be used.
127-
namespace: ingress
128-
type: public
129-
auth: true
130112
- name: external-dns
131113
tags: [ingress, security, tls]
132114
- name: gitea
133115
tags: [git]
134116
isShared: true
135117
ownHost: true
136118
path: /user/oauth2/otomi-idp
137-
ingress:
138-
- namespace: gitea
139-
svc: gitea-http
140-
port: 3000
141-
type: public
142119
- name: grafana
143120
tags: [tracing, telemetry, observability]
144121
deps: [prometheus]
145122
path: /dashboards
146123
ownHost: true
147-
ingress:
148-
- svc: po-grafana
149-
namespace: grafana
150-
removeRequestHeaders:
151-
- authorization
152-
type: public
153-
auth: true
154124
- name: harbor
155125
tags: [security]
156126
isShared: true
157127
ownHost: true
158-
ingress:
159-
- svc: harbor-portal
160-
namespace: harbor
161-
type: public
162-
auth: true
163-
- svc: harbor-core
164-
namespace: harbor
165-
paths: [/api/, /c/]
166-
forwardPath: true
167-
type: public
168-
auth: true
169-
- svc: harbor-core
170-
namespace: harbor
171-
paths: [/chartrepo/, /service/, /v1/, /v2/]
172-
forwardPath: true
173-
type: public
174-
hasOwnIngress: true
175128
- name: hello
176129
hide: true
177130
tags: [demo]
178-
- name: ingress-nginx
179-
tags: [ingress, auth]
180131
- name: istio
181132
tags: [ingress, egress, routing, security, tls, observability, policies]
182133
- name: keycloak
183134
path: /admin/otomi/console/
184135
tags: [auth, sso]
185-
# isShared: true
186136
ownHost: true
187-
ingress:
188-
- namespace: keycloak
189-
svc: keycloak-keycloakx-http
190-
type: public
191-
port: 8080
192137
- name: knative
193138
tags: [serverless, functions]
194139
deps: [istio]
195140
- name: kubeflow-pipelines
196141
tags: [ai, ml]
197142
ownHost: true
198143
isShared: true
199-
ingress:
200-
- svc: ml-pipeline-ui
201-
namespace: kfp
202-
port: 80
203-
type: public
204-
auth: true
205144
- name: kserve
206145
tags: [ai]
207146
- name: tekton
208147
tags: [buildpacks, ci, pipelines]
209148
ownHost: true
210149
path: /#/namespaces/team-admin/pipelineruns
211-
ingress:
212-
- svc: tekton-dashboard
213-
namespace: tekton-pipelines
214-
port: 9097
215-
type: public
216-
auth: true
217-
removeRequestHeaders:
218-
- authorization
219150
- name: loki
220151
tags: [logging, telemetry, observability]
221152
deps: [grafana, prometheus, otel]
@@ -225,37 +156,13 @@ adminApps:
225156
hide: true
226157
isShared: true
227158
ownHost: true
228-
ingress:
229-
- svc: otomi-api
230-
namespace: otomi
231-
paths: [/api/]
232-
type: public
233-
auth: true
234-
- svc: otomi-console
235-
namespace: otomi
236-
type: public
237-
auth: true
238159
- name: api # Used by any client that do not support cookies
239160
hide: true
240161
isShared: true
241162
ownHost: true
242-
ingress:
243-
- svc: otomi-api
244-
namespace: otomi
245-
type: public
246-
# RequestAuthentication and AuthorizationPolicy ensure Authorization header validation
247-
auth: false
248-
249163
- name: prometheus
250164
tags: [metrics, observability]
251165
ownHost: true
252-
ingress:
253-
- svc: po-prometheus
254-
port: 9090
255-
namespace: monitoring
256-
# namespace: prometheus
257-
type: public
258-
auth: true
259166
- name: sealed-secrets
260167
tags: [secrets, security, observability]
261168
ownHost: true
@@ -273,33 +180,11 @@ teamApps:
273180
- name: alertmanager
274181
ownHost: true
275182
path: /#/alerts?silenced=false&inhibited=false&active=true&filter=%7Bnamespace%3D"team-#TEAM#"%7D
276-
ingress:
277-
- svc: po-alertmanager
278-
hasPrefix: true
279-
port: 9093
280-
type: public
281-
auth: true
282183
- name: grafana
283184
ownHost: true
284185
path: /dashboards
285-
ingress:
286-
- svc: po-grafana
287-
hasPrefix: true
288-
forwardPath: true
289-
removeRequestHeaders:
290-
- authorization
291-
type: public
292-
auth: true
293186
- name: loki
294187
useHost: grafana
295188
path: /explore?orgId=1&left=%7B"datasource":"loki","queries":%5B%7B"refId":"A","expr":"","queryType":"range","datasource":%7B"type":"loki","uid":"loki"%7D%7D%5D,"range":%7B"from":"now-1h","to":"now"%7D%7D
296189
- name: tekton
297190
ownHost: true
298-
ingress:
299-
- svc: tekton-dashboard
300-
hasPrefix: true
301-
port: 9097
302-
type: public
303-
auth: true
304-
removeRequestHeaders:
305-
- authorization

test/env/teams/apps.admin.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ teamConfig:
99
gitea: {}
1010
grafana: {}
1111
harbor: {}
12-
ingress-nginx: {}
1312
istio: {}
1413
keycloak: {}
1514
knative: {}

0 commit comments

Comments
 (0)