In order to launch a Puppet Server using the puppet/puppetserver-standalone image we'll need a Kubernetes Service and a Deployment. We could generate the required configurations from a Docker Compose file.
For this we'll use Kompose. With Kompose installed we simply need to run the following command to launch our Puppet Server.
kompose up
If you'd like to see the generated Kubernetes configuration files you can run the following command:
kompose convert
This should generate a puppet-service.json file along with a puppet-deployment.json file in the local directory.
We're going to test out our Puppet Server from our local machine so we'll need to expose it externally outside our cluster.
kubectl expose service puppet --port=8140 --target-port=8140 --name=puppet-external --type=LoadBalancer
We can watch the new service launch and then add an external load balancer.
kubectl get service puppet-external --watch
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
puppet-external 10.107.245.142 <pending> 8140/TCP 40s
...
puppet-external 10.107.245.142 123.456.78.91 8140/TCP 54s