# Plugin configmap and kubernetes

**URL:** <https://forum.mattermost.com/t/plugin-configmap-and-kubernetes/13429>\
**Category:** Troubleshooting\
**Created:** [May 23, 2022, 12:01pm UTC](https://forum.mattermost.com/t/plugin-configmap-and-kubernetes/13429 "2022-05-23T12:01:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarce666](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/sarce666/32/5532_2.png) [@sarce666](https://forum.mattermost.com/u/sarce666)\
**Post date:** [May 23, 2022, 12:01pm UTC](https://forum.mattermost.com/t/plugin-configmap-and-kubernetes/13429/1 "2022-05-23T12:01:20Z")

</div>

hello

i deployed matermost on kubernetes with operator  
i d like to configure the welcpome bot  
so i create a config map with the config.json

and in my installation i put a mountpath for this file :

volumeMounts:  
- name: welcome  
mountPath: /mattermost/plugins/com.mattermost.welcomebot/plugin.json  
subPath: plugin.json  
volumes:  
- name: welcome  
configMap:  
name: welcome  
items:  
- key: plugin.json  
path: plugin.json

it works , the file is mounted but when i deploy it i go this error

{“timestamp”:“2022-05-23 12:00:50.372 Z”,“level”:“error”,“msg”:“Unable to move plugin from temporary directory to final destination. Another plugin may be using the same directory name.”,“caller”:“web/context.go:105”,“path”:“/api/v4/plugins/marketplace”,“request\_id”:“53rw596ctpf3pqrqpqhfqu1gha”,“ip\_addr”:",“user\_id”:“jei45ycqufr55gd7usqknyyoio”,“method”:“POST”,“err\_where”:“installExtractedPlugin”,“http\_code”:500,“err\_details”:“destination already exists”}

---

<div class="post-metadata">

**Author:** ![BenLloydPearson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/benlloydpearson/32/4841_2.png) [@BenLloydPearson](https://forum.mattermost.com/u/BenLloydPearson)\
**Post date:** [May 27, 2022, 8:07pm UTC](https://forum.mattermost.com/t/plugin-configmap-and-kubernetes/13429/2 "2022-05-27T20:07:56Z")

</div>

Hi @sarce666, thanks for bringing this to our attention! I checked with some of our engineers ([here’s the conversation](https://community.mattermost.com/core/pl/t7zwfs47r3rn8b41b56nxrqw6a)) and this appears to be a [known problem](https://github.com/mattermost/mattermost-operator/issues/228), and isn’t something we have plans to support.

However, you should be able to work around this issue with [mmctl](https://docs.mattermost.com/manage/mmctl-command-line-tool.html) which has a `config` command to get and set configurations for Mattermost and any plugins you have installed.

For example, you can use the command `mmctl config get PluginSettings.Plugins.com.mattermost.welcomebot` to get welcomebot’s current configuration and change “get” to “set” to modify it. Here’s some more info about the [config command](https://docs.mattermost.com/manage/mmctl-command-line-tool.html#mmctl-config).

Let me know if this solves your issue.

---

<div class="post-metadata">

**Author:** ![sarce666](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/sarce666/32/5532_2.png) [@sarce666](https://forum.mattermost.com/u/sarce666)\
**Post date:** [May 30, 2022, 8:13am UTC](https://forum.mattermost.com/t/plugin-configmap-and-kubernetes/13429/3 "2022-05-30T08:13:35Z")

</div>

thanks

but how to sent this command in the first installation yaml file:  
apiVersion: [installation.mattermost.com/v1beta1](http://installation.mattermost.com/v1beta1)  
kind: Mattermost  
command is not recognize there

---

<div class="post-metadata">

**Author:** ![BenLloydPearson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/benlloydpearson/32/4841_2.png) [@BenLloydPearson](https://forum.mattermost.com/u/BenLloydPearson)\
**Post date:** [June 1, 2022, 12:27pm UTC](https://forum.mattermost.com/t/plugin-configmap-and-kubernetes/13429/4 "2022-06-01T12:27:03Z")

</div>

If I understand your question, you’re asking how to do this when you first install Mattermost? If so, you should be able to do it by installing mmctl to any host that is capable of communicating with your Kubernetes cluster. You can then trigger the mmctl command manually or automate it with a bash script or something similar.

---

<div class="post-metadata">

**Author:** ![sarce666](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/sarce666/32/5532_2.png) [@sarce666](https://forum.mattermost.com/u/sarce666)\
**Post date:** [June 7, 2022, 6:28am UTC](https://forum.mattermost.com/t/plugin-configmap-and-kubernetes/13429/5 "2022-06-07T06:28:23Z")

</div>

hello

this is a bit what i though , but i would prefer an automate possibilities in the deployment  
that means if i redeploy or one of my pods restart i lose everyhting and i have to do it manually  
so i loose all the good point of kubernetes  
or is there a way to have the the /mattermost/plugins in presistence mode so i keep it when restarting my pods

i dont see any options in the spec in the orchestrator either ?

thanks

---

<div class="post-metadata">

**Author:** ![BenLloydPearson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/benlloydpearson/32/4841_2.png) [@BenLloydPearson](https://forum.mattermost.com/u/BenLloydPearson)\
**Post date:** [June 7, 2022, 6:36pm UTC](https://forum.mattermost.com/t/plugin-configmap-and-kubernetes/13429/6 "2022-06-07T18:36:24Z")

</div>

@sarce666 I did some investigation and came across [this possible answer](https://stackoverflow.com/a/61211015). Does this help with your problem?

---

<div class="post-metadata">

**Author:** ![sarce666](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/sarce666/32/5532_2.png) [@sarce666](https://forum.mattermost.com/u/sarce666)\
**Post date:** [June 9, 2022, 11:45am UTC](https://forum.mattermost.com/t/plugin-configmap-and-kubernetes/13429/7 "2022-06-09T11:45:00Z")

</div>

hello ben

ut , when I start my deployment , my mattermost pods is created with a random name :

db-523050-mysql-0 4/4 Running 2 (6d19h ago) 6d19h  
metis-64797d5b58-qbqs2 1/1 Running 0 6d19h

in my exemple it is metis-64797d5b58-qbqs2

so how can I put this info in the initial deployement as it does not yet know it ?

as far as I understand you want me to send the mmtcl command in the mattermost pod ?

apiVersion: [installation.mattermost.com/v1beta1](http://installation.mattermost.com/v1beta1)  
kind: Mattermost  
metadata:  
name: metis # Chose the desired name  
spec:  
size: 100users # Adjust to your requirements  
ingress:  
enabled: true  
host: [metis.cyberpeaceinstitute.org](http://metis.cyberpeaceinstitute.org) # Adjust to your domain  
annotations:  
[kubernetes.io/ingress.class:](http://kubernetes.io/ingress.class:) nginx  
version: 6.6.1  
licenseSecret: “mattermost-license4”

apiVersion: v1  
kind: Pod  
metadata:  
name: mattermost  
labels:  
app: mattermost  
purpose: mmctl  
spec:  
containers:  
- name: mattermost  
image: mattermost/mattermost-enterprise-edition:6.6.1  
command: [“mmctl config get PluginSettings.Plugins.com.mattermost.welcomebot”]

another issue

if i launch the command on a starting pod i have this error after i auth  
I got this

~ $ mmctl config get PluginSettings.Plugins.com.mattermost.welcomebot

WARNING: server version 6.6.1.6.6.1.8827b6decd348d2ef39d811cc0178d32.true doesn’t match mmctl version

Error: invalid key
