Difference between revisions of "Kubectl create clusterip"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Line 20: Line 20:
  
 
* <code>[[ClusterIP]]</code> (default ServiceType): exposes the Service on a cluster internal IP then your service is only reachable from within the cluster.
 
* <code>[[ClusterIP]]</code> (default ServiceType): exposes the Service on a cluster internal IP then your service is only reachable from within the cluster.
 +
* <code>[[kubectl get service]] | grep ClusterIP</code>
  
  

Revision as of 11:10, 31 March 2023

kubectl create clusterip

kubectl create service clusterip


apiVersion: v1
kind: Service
metadata:
  name: my-service
spec:
  selector:
    app.kubernetes.io/name: MyApp
  ports:
    - protocol: TCP
      port: 80
      targetPort: 9376
  • ClusterIP (default ServiceType): exposes the Service on a cluster internal IP then your service is only reachable from within the cluster.
  • kubectl get service | grep ClusterIP


See also

Advertising: