kubectl expose
Take a replication controller, service, deployment or pod and expose it as a new Kubernetes service kubectl reference
24 options Its page in the kubectl reference
Options
--allow-missing-template-keysIf true, ignore any errors in templates when a field or map key is missing in the template.--cluster-ipClusterIP to be assigned to the service.--dry-runMust be "none", "server", or "client".--external-ipAdditional external IP address (not managed by Kubernetes) to accept for the service.--field-managerName of the manager used to track field ownership.--filename, -fFilename, directory, or URL to files identifying the resource to expose a service--help, -hhelp for expose--kustomize, -kProcess the kustomization directory.--labels, -lLabels to apply to the service created by this call.--load-balancer-ipIP to assign to the LoadBalancer.--nameThe name for the newly created object.--output, -oOutput format.--override-typeThe method used to override the generated object: json, merge, or strategic.--overridesAn inline JSON override for the generated object.--portThe port that the service should serve on.--protocolThe network protocol for the service to be created.--recursive, -RProcess the directory used in -f, --filename recursively.--save-configIf true, the configuration of current object will be saved in its annotation.--selectorA label selector to use for this service.--session-affinityIf non-empty, set the session affinity for the service to this; legal values: 'None', 'ClientIP'--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.--target-portName or number for the port on the container that the service should direct traffic to.--templateTemplate string or path to template file to use when -o=go-template, -o=go-template-file.--typeType for this service: ClusterIP, NodePort, LoadBalancer, or ExternalName.