Hello,
we are using Sametime 12.0.1 on Kubernetes 1.21.x
We are using customized environment for business card (UserInfoConfig.xml) and policies (policies.user.xml).
If we extract the policies (user & server) from the community-pod via ...
=> https://bityl.co/GvdC
> kubectl exec -it <communitypodID> --namespace sametime --container community -- cat /local/notesdata/policies.user.xml > ./policies.user.xml
> kubectl exec -it <communitypodID> --namespace sametime --container community -- cat /local/notesdata/policies.server.xml > ./policies.server.xml
... and trying to import both files into the kubernetes configmap
> kubectl create configmap extra-community-policy --from-file=./
.. no data was imported to the configmap extra-community-policy or the configmap has no data section.
If we try to import temporary this two files (policies.user.xml & policies.server.xml) into a secret ...
> kubectl create secret generic extra-community-policy --from-file=./
also the secret has no data.
It seems that kubernetes could not import this two files into configmap/secrets.
Importing extracted UserInfoConfig.xml / STCommunityConfig.xml into secrets
=> https://bityl.co/Gvew
> kubectl create secret generic extra-community-config --from-file=./
works w/o problems.
Anyone problems with sametime personalized policy files on kubernetes ? Could this be a formatting issue with the policy files ?
Hi Alexander,
The help center command is wrong. The command to create the configmap is like this:
kubectl create configmap extra-community-policy --from-file=./
If using a namespace for Sametime, include the namespace argument like this:
kubectl -n stprod create configmap extra-community-policy --from-file=./
I will put in an update to have the help center topic fixed.
Thanks,
Casey
Sorry I just re-read what you wrote and see you have the ./ already.
When you use the ./ it gets all the files in the current directory.
What I do is create a folder name with the same name as the configmap, and switch directories to it first. Then run the kubectl exec commands to copy the desired files. Here are the commands that worked for me (note -mine is installed in a namespace "stprod"):
mkdir extra-community-policy
cd extra-community-policy
kubectl -n stprod exec -it community-666df89bbc-gfdwz --container community -- cat /local/notesdata/policies.server.xml > ./policies.server.xml
kubectl -n stprod exec -it community-666df89bbc-gfdwz --container community -- cat /local/notesdata/policies.user.xml > ./policies.user.xml
extra-community-policy]# ls
policies.server.xml policies.user.xml
I then used vi to modify policies.user.xml, just changed one setting for testing.
Create the configmap:
kubectl -n stprod create configmap extra-community-policy --from-file=./
View the configmap:
kubectl -n stprod get cm
NAME DATA AGE
extra-community-policy 2 6s
nginx-ingress-ingress-nginx-controller 1 145d
sametime-community-ini 1 60d
sametime-community-logging 13 118d
sametime-global-config 115 118d
I can also see the xml data inside if I issue the kubectl describe cm.
I suspect that your files aren't getting read for some reason. Are you running the kubectl from the directory where the two files are?
Please open a case with HCL Support if you continue to have trouble.
Thanks!
Casey
Hello,
thank you for the great hint.
After i changed a parameter within the two files and safed it, i could import both files into the configmap and also i can see the entries of both files via
> kubectl edit secret -n sametime extra-community-policy
Do you know if i can change policy settings directly within the configmap editor ?
> kubectl edit secret -n sametime extra-community-policy -o yaml
or do i have to delete the configmap, change my settings and create a new configmap with the changed files ?
Yes, I think you can edit the live configmap. XML formatting can get a little squirrely, so if it does not get read properly, you may want to just edit the copies on your system and delete/recreate the configmap.
The configmap editor, at least on mine uses the same commands as vi, so to edit, press lower case i to go into insert mode. Then to save, esc wq!
If you need to go the route of delete/recreate, then the command to delete the cm is:
kubectl delete cm extra-community-policy
FYI - By default kubectl edit will use vi as the editor (assuming that vi is the default editor in your environment). If you want to use a different editor, create an environment variable named KUBE_EDITOR with the value set to the path of your preferred text editor (e.g. nano).