This is a script I wrote for EA for rigging tentacles. One of the short comings of most tentacle rigs is that they are nurbs or spline IK based creating problems keeping the tentacle in proximity with geo they are supposed to be interacting with.
On this rig, the tentacle passes directly through the center of each controller. The IKstate controller acts as an up vector for that controller. The tentacle twists to match that up vector. The script creates FK, local IK, and world IK controllers
Here is a short video of the rig.