How to Find What Resource to List for `kind:`
November 6, 2024
note-to-self
k8s
When creating an application in kubernetes, there are a lot of values for the kind:
field. This is how to find those, and explain them so you know what values should be there.
Example:
apiVersion: v1
kind: Service
metadata:
name: hello-world-service
spec:
selector:
app: hello-world
ports:
- protocol: TCP
port: 80
targetPort: 80
type: ClusterIP
The Resource in there is Service
. To get the full list, do: kubectl api-resources
.
Then, you can view more information in each one by doing kubectl explain <resource>
, eg kubectl explain pods
or kubectl explain service