@@ -57,9 +57,10 @@ URL as a secret. Additionally, if accessing Coder over a hostname, set the `CODE
57
57
value.
58
58
59
59
By default, Coder creates the cache directory in` /home/coder/.cache ` . Given the
60
- OpenShift-provided UID, the Coder container does not have permission to write to
61
- this directory. To fix this, set the` CODER_CACHE_DIRECTORY ` environment variable
62
- to` /tmp/coder-cache ` .
60
+ OpenShift-provided UID and` readOnlyRootFS ` security context constraint, the Coder
61
+ container does not have permission to write to this directory.
62
+ To fix this, you can mount a temporary volume in the pod and set
63
+ the` CODER_CACHE_DIRECTORY ` environment variable to that location.
63
64
64
65
Additionally, create the Coder service as a` ClusterIP ` . In the next step,
65
66
you will create an OpenShift route that points to the service HTTP target port.
70
71
type :ClusterIP
71
72
env :
72
73
-name :CODER_CACHE_DIRECTORY
73
- value :/tmp/coder- cache
74
+ value :/cache
74
75
-name :CODER_PG_CONNECTION_URL
75
76
valueFrom :
76
77
secretKeyRef :
@@ -82,7 +83,15 @@ coder:
82
83
runAsNonRoot :true
83
84
runAsUser :<project-specific UID>
84
85
runAsGroup :<project-specific GID>
85
- readOnlyRootFilesystem :false
86
+ readOnlyRootFilesystem :true
87
+ volumes :
88
+ -name :" cache"
89
+ emptyDir :
90
+ sizeLimit :500Mi
91
+ volumeMounts :
92
+ -name :" cache"
93
+ mountPath :" /cache"
94
+ readOnly :false
86
95
` ` `
87
96
88
97
> Note: OpenShift provides a Developer Catalog offering you can use to