Yeah I tried this in v2 and v3 spec and I get an error:
config_content = self._build_grafana_ini()
spec = {
"version":3,
"containers": [
{
"name": self.app.name,
"imageDetails": {"imagePath": "grafana/grafana:7.2.1-ubuntu"},
"ports": [{"containerPort": port, "protocol": "TCP"}],
"volumeConfig": {
"name": "grafana-config-ini",
"mountPath": "/etc/grafana",
"files": {"grafana.ini": config_content},
},
"kubernetes": {
"securityContext":{
#"runAsNonRoot": true
"runAsUser": 472,
"fsGroup": 472,
},
"readinessProbe": {
"httpGet": {"path": "/api/health", "port": port},
"initialDelaySeconds": 10,
"timeoutSeconds": 30,
},
},
}
]
}
ops.model.ModelError: b'ERROR json: unknown field "fsGroup"\n'
Which suggests to me that the securityContext tag is in the correct place but it hasn’t got a clue what to do with the fsGroup value.