Difference between revisions of "Kind: Service"
Jump to navigation
Jump to search
Tags: Mobile web edit, Mobile edit |
|||
Line 17: | Line 17: | ||
[[targetPort:]] 9376 | [[targetPort:]] 9376 | ||
+ | == Examples == | ||
+ | |||
+ | apiVersion: v1 | ||
+ | kind: Service | ||
+ | metadata: | ||
+ | annotations: {} | ||
+ | name: your_app | ||
+ | namespace: your_namespace | ||
+ | spec: | ||
+ | ports: | ||
+ | - name: http | ||
+ | port: 8080 | ||
+ | protocol: TCP | ||
+ | targetPort: 8080 | ||
+ | selector: | ||
+ | app: watch | ||
+ | sessionAffinity: None | ||
+ | type: ClusterIP | ||
== Related == | == Related == |
Revision as of 12:03, 10 October 2023
kind: Service
to create a Kubernetes service
Contents
Oficial example
apiVersion: v1 kind: Service metadata: name: my-service spec: selector: app: MyApp ports: - protocol: TCP port: 80 targetPort: 9376
Examples
apiVersion: v1 kind: Service metadata: annotations: {} name: your_app namespace: your_namespace spec: ports: - name: http port: 8080 protocol: TCP targetPort: 8080 selector: app: watch sessionAffinity: None type: ClusterIP
Related
See also
- Kubernetes services,
kubectl get services, kubectl describe service
,kubectl create service
[loadbalancer
|nodeport
|clusterip
|externalname ], kubectl expose
,headless service, service.beta.kubernetes.io
kind:
[Pod | Ingress | ClusterConfiguration
|Config | ConfigMap | ServiceAccount | Deployment | List | Secret | Status ], spec: metadata: data:
Advertising: