File tree Expand file tree Collapse file tree 2 files changed +56
-3
lines changed
install/installer/pkg/components/openvsx-proxy Expand file tree Collapse file tree 2 files changed +56
-3
lines changed Original file line number Diff line number Diff line change @@ -17,25 +17,31 @@ import (
17
17
)
18
18
19
19
func configmap (ctx * common.RenderContext ) ([]runtime.Object , error ) {
20
- // todo(sje): enable redis config
21
20
imgcfg := openvsx.Config {
22
21
LogDebug : false ,
23
- CacheDurationRegular : util .Duration (time .Minute ),
22
+ CacheDurationRegular : util .Duration (time .Minute * 5 ),
24
23
CacheDurationBackup : util .Duration (time .Hour * 72 ),
25
24
URLUpstream : ctx .Config .OpenVSX .URL ,
26
25
URLLocal : fmt .Sprintf ("https://open-vsx.%s" , ctx .Config .Domain ),
27
26
MaxIdleConns : 1000 ,
28
27
MaxIdleConnsPerHost : 1000 ,
29
28
PrometheusAddr : fmt .Sprintf (":%d" , PrometheusPort ),
29
+ RedisAddr : "localhost:6379" ,
30
30
}
31
31
32
+ redisCfg := `
33
+ maxmemory 100mb
34
+ maxmemory-policy allkeys-lfu
35
+ `
36
+
32
37
fc , err := common .ToJSONString (imgcfg )
33
38
if err != nil {
34
39
return nil , fmt .Errorf ("failed to marshal openvsx config: %w" , err )
35
40
}
36
41
37
42
data := map [string ]string {
38
43
"config.json" : string (fc ),
44
+ "redis.conf" : redisCfg ,
39
45
}
40
46
41
47
return []runtime.Object {
Original file line number Diff line number Diff line change @@ -99,8 +99,55 @@ func statefulset(ctx *common.RenderContext) ([]runtime.Object, error) {
99
99
Env : common .MergeEnv (
100
100
common .DefaultEnv (& ctx .Config ),
101
101
),
102
- }},
102
+ }, {
103
+ Name : "redis" ,
104
+ Image : "redis:6.2" ,
105
+ Command : []string {
106
+ "redis-server" ,
107
+ "/config/redis.conf" ,
108
+ },
109
+ Env : []v1.EnvVar {{
110
+ Name : "MASTER" ,
111
+ Value : "true" ,
112
+ }},
113
+ ImagePullPolicy : "IfNotPresent" ,
114
+ Ports : []v1.ContainerPort {{
115
+ ContainerPort : 6379 ,
116
+ }},
117
+ Resources : v1.ResourceRequirements {
118
+ Requests : v1.ResourceList {
119
+ "cpu" : resource .MustParse ("1m" ),
120
+ "memory" : resource .MustParse ("512Mi" ),
121
+ },
122
+ },
123
+ VolumeMounts : []v1.VolumeMount {{
124
+ Name : "config" ,
125
+ MountPath : "/config" ,
126
+ }, {
127
+ Name : "redis-data" ,
128
+ MountPath : "/data" ,
129
+ }},
130
+ },
131
+ },
132
+ },
133
+ },
134
+ VolumeClaimTemplates : []v1.PersistentVolumeClaim {{
135
+ ObjectMeta : metav1.ObjectMeta {
136
+ Name : Component ,
137
+ Namespace : ctx .Namespace ,
138
+ Labels : labels ,
103
139
},
140
+ Spec : v1.PersistentVolumeClaimSpec {
141
+ AccessModes : []v1.PersistentVolumeAccessMode {
142
+ v1 .ReadWriteOnce ,
143
+ },
144
+ Resources : v1.ResourceRequirements {
145
+ Requests : v1.ResourceList {
146
+ "storage" : resource .MustParse ("8Gi" ),
147
+ },
148
+ },
149
+ },
150
+ },
104
151
},
105
152
},
106
153
}}, nil
You can’t perform that action at this time.
0 commit comments