Skip to content

Commit

Permalink
k8s: Support app ingress annotation (#2198)
Browse files Browse the repository at this point in the history
  • Loading branch information
shamoon authored Oct 18, 2023
1 parent b8eda91 commit 4248db7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/configs/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ metadata:
gethomepage.dev/description: Media Server
gethomepage.dev/group: Media
gethomepage.dev/icon: emby.png
gethomepage.dev/app: emby-app # optional, may be needed if app.kubernetes.io/name != ingress metadata.name
gethomepage.dev/name: Emby
gethomepage.dev/widget.type: "emby"
gethomepage.dev/widget.url: "https://emby.example.com"
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/kubernetes/stats/[...service].js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default async function handler(req, res) {

if (pods.length === 0) {
res.status(404).send({
error: "not found"
error: `no pods found with namespace=${namespace} and labelSelector=${labelSelector}`,
});
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/kubernetes/status/[...service].js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default async function handler(req, res) {

if (pods.length === 0) {
res.status(404).send({
error: "not found",
error: `no pods found with namespace=${namespace} and labelSelector=${labelSelector}`,
});
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/config/service-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export async function servicesFromKubernetes() {
)
.map((ingress) => {
let constructedService = {
app: ingress.metadata.name,
app: ingress.metadata.annotations[`${ANNOTATION_BASE}/app`] || ingress.metadata.name,
namespace: ingress.metadata.namespace,
href: ingress.metadata.annotations[`${ANNOTATION_BASE}/href`] || getUrlFromIngress(ingress),
name: ingress.metadata.annotations[`${ANNOTATION_BASE}/name`] || ingress.metadata.name,
Expand Down

0 comments on commit 4248db7

Please sign in to comment.