-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathghomekodi.jsonnet
84 lines (76 loc) · 3.83 KB
/
ghomekodi.jsonnet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// https://github.com/OmerTu/GoogleHomeKodi
local kube = import "kube.libsonnet";
local kubecfg = import "kubecfg.libsonnet";
local utils = import "utils.libsonnet";
// Nov 5, 2017
local version = "3824e0ee27df3d081371785d0f20cce8dfd835e3";
local port = 8099;
{
namespace:: {metadata+: {namespace: "google-home-kodi"}},
ns: kube.Namespace($.namespace.metadata.namespace),
ingress: utils.Webhook("google-home-kodi", "/ifttt-kodi") + $.namespace {
metadata+: {
annotations+: {"nginx.ingress.kubernetes.io/rewrite-target": "/"},
},
target_svc: $.svc,
},
config: utils.SealedSecret("google-home-kodi") + $.namespace {
// If data_ is changed, reseal with ./seal.sh ghomekodi-secret.jsonnet
data_: {
kodi:: {
id: "kodi",
kodiIp: "tellymonster.lan",
kodiPort: "8080",
kodiUser: "kodi",
kodiPassword: error "secret! kodi password not overridden",
},
global:: {
authToken: error "secret! authToken not overridden",
listenerPort: std.toString(port),
youtubeKey: error "secret! youtubeKey not overridden",
},
"kodi-hosts.config.js": |||
exports.kodiConfig = %s;
exports.globalConfig = %s;
||| % [
kubecfg.manifestJson([self.kodi]),
kubecfg.manifestJson(self.global),
],
},
spec+: {
data: "AgBZSJeeKEkNs3IXt+UloaftbdYMlAjc5FeWAs8Bct08aFmv20PHnvixVjd6pWtbWg7fLZmpHt/8Q8p+7D2kFNQar64R6ySW2VJjtunnAUNzkxgcegPrbGU1atvJY/s4xiqeVVkGHPl9H6EpQ2dvxFydSx6jSMtDfln9QRtSMSMC5rpVX9CdjCBl5F9Y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GoKREWnpLMuYsS7YTACdnAgN0/BKS3xMwkkol3+NWQwK3EzruZSxlU+2k9opkzLunFW0V28u6j9e2L1Mtw69eb2na6psYCYWrrPrM4giQGKpvDoFHGHP3xHfTf8I7O7w5tV/OO32GJhZ6X8de89We4PXMfGcQSqel6vCOTNMLBVE2bQWFUPF9MsxZC0f2wkk2tcVx/6UJqxqSCXOJQvkFaofeXqaNzrE9YlRZFx923Bc6/ebYXSACjQQoxBQtRJfL7MKN6MiAE2h3L02Fc20fhk=",
},
},
svc: kube.Service("google-home-kodi") + $.namespace {
target_pod: $.deploy.spec.template,
},
deploy: kube.Deployment("google-home-kodi") + $.namespace {
local this = self,
spec+: {
template+: {
spec+: {
nodeSelector+: utils.archSelector("amd64"),
volumes_+: {
config: kube.SecretVolume($.config),
},
containers_+: {
default: kube.Container("server") {
image: "anguslees/docker-googlehomekodi", // renovate
workingDir: "/app/GoogleHomeKodi",
ports_+: {
default: {containerPort: port, protocol: "TCP"},
},
volumeMounts_+: {
config: {
mountPath: "/app/GoogleHomeKodi/kodi-hosts.config.js",
subPath: "kodi-hosts.config.js",
readOnly: true,
},
},
},
},
},
},
},
},
}