Closed keinou closed 2 years ago
the namespace should be defined in the config file
ie.
apiVersion: v1
kind: Service
metadata:
name: test
namespace: customnamespace
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: 8080
selector:
app: hello-kubernetes
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-kubernetes
namespace: customnamespace
spec:
replicas: 3
selector:
matchLabels:
app: hello-kubernetes
template:
metadata:
labels:
app: hello-kubernetes
spec:
containers:
- name: hello-kubernetes
image: paulbouwer/hello-kubernetes:1.8
ports:
- containerPort: 8080
Thanks
https://kubernetes.io/docs/tasks/administer-cluster/namespaces/ also if namespace does not exists yet you can place this in your yaml config before the service
apiVersion: v1
kind: Namespace
metadata:
name: <insert-namespace-name-here>
how define the namespace of apply?