Configuring the class file on Kubernetes
You can use a custom Java class file to transform your searches for LDAP for the community pod.
You must have already created and compiled the class file using Java 1.8.
To configure a custom Java class file to transform your searches for LDAP for the community pod in Kubernetes you need to complete the following tasks.
- Create a ConfigMap with your compiled class file
- Modify the community pod.yaml file to load the ConfigMap
- Override the default LDAP settings to use the class file
The changes in this task affect the following pods:
-
community
-
Create a configmap with your compiled class file.
-
Name the compiled class file StLdapCustomizedAttributes.class.
-
Create a folder on the machine where you run the kubectl commands called ldap-custom-filter.
-
Place the StLdapCustomizedAttributes.class file into the ldap-custom-filter folder.
-
Change directories to the ldap-custom-filter folder.
-
Run the following command to create a ConfigMap with the StLdapCustomizedAttributes.class within it.
kubectl create configmap ldap-custom-filter --from-file=./
Note: If you have a namespace dedicated to Sametime, add the -n argument with your namespace to ensure it is created in the correct namespace.
-
-
Modify the pod.yaml file for the community pod to load the ConfigMap.
-
Use a text editor to open the file pod.yaml in the helm/charts/community/templates/ directory.
-
Locate the
volumeMounts:
section and under the firstmountPath,
statement create a new line and add the following stanza.- name: ldap-custom-filter configMap: ldap-custom-filter name:
-
Correct the indentation using only spaces so that the alignment of the new lines is the same as the lines above it. When finished it should look like the following:
-
Save and close the pod.yaml file.
-
-
Override the default LDAP settings to use the class file.
-
Make a directory on your machine called extra-community-config at the root of where the Sametime installation package was decompressed.
-
Change to the extra-community-config directory.
-
Find the community pod name by running the get pods command. The pod name has some hashes in it, for example:
community-77d4695988-2bzrx):
.kubectl get pods
-
Pull a copy of the StCommunityConfig.xml file from the community pod.
Run the following command, where podname is the pod name found in the previous step.
kubectl exec -it pod\_name --container community -- cat /local/notesdata/StCommunityConfig.xml >./StCommunityConfig.xml
-
Pull a copy of the StCommunityConfig.xml file from the community pod.
Run the following command, where podname is the pod name which is the same as the previous step.
kubectl exec -it pod\_name --container community -- cat /local/notesdata/StCommunityConfig.xml >./StCommunityConfig.xml
-
Update the configuration that pertains to your custom Java class. Open the StCommunityConfig.xml file that was copied to your machine. Then edit the
<LDAP>
section as it pertains to your configuration. The changes depend on what you are modifying, refer to the following table for guidance.Type of change Parameter name What to specify Example Search filter for resolving person names PersonResolveFilter classname.methodname() for your custom code StLdapCustomized.peopleResolveFilter()
Search filter for resolving group names GroupResolveFilter Class name and method name for a group filter, using the following format: Classname.methodname()
StLdapCustomized.groupsResolveFilter()
.Attribute of the person entry that defines the person's name DescAttribute Class name and method name for the formatting, with the name of the attribute inside, for example: Classname.methodname(attribute_name) StLdapCustomizedAttributes.displayName(cn)
-
Save and close the StCommunityConfig.xml file.
-
Ensure you are in the extra-community-config directory that was created earlier then run the following command to create the secret.
kubectl create secret generic extra-community-config --from-file=./
Note: If you have a namespace dedicated to Sametime, add the -n argument with your namespace to ensure it is created in the correct namespace.
-
Change to the helm directory where the Sametime installation package was decompressed.
-
Open thevalues.yaml file and place in edit mode.
-
Add the following line.
overrideCommunityConfigSecret: extra-community-config
-
Save and close the values.yaml file.
-
-
Apply your changes to the environment.
Verify that you are in the helm directory and run the following command to apply changes. Specify the Sametime deployment name for your environment. The default for Sametime Premium version 12 is sametime.
helm upgrade sametime\_deployment\_name .
Note: Be sure to include the dot at the end. It is part of the command.
If you are unsure of your deployment name, issue the helm list command to find the name. If you upgraded from an earlier Sametime release, the default name is sametime-meetings.
-
Restart the pods with the changes. Use the kubectl scale command to scale the pods to zero and then to one that have been changed. You must run the commands for each pod that the change affects.
-
Run the following command to scale the pod to zero.
Scale the pod to zero, where pod_deployment_name is the pod name.
kubectl scale deploy pod\_deployment\_name --replicas=0
-
Run the following command to scale the pod to one.
kubectl scale deploy pod\_deployment\_name --replicas=1
-
Parent Topic: Creating custom Java classes for searching LDAP