Hi,
I’m using rancher v1.2 with kubernetes orchestration, I tried to create a deployment and service with below yaml:
Here’s the deployment: (The post removed my spaces before my lines…I don’t know how to add them back)
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: mynginx
spec:
replicas: 2
template:
metadata:
labels:
name: mynginx
spec:
containers:
- name: mynginx
image: nginx
ports:
- containerPort: 80
And here’s the service:
apiVersion: v1
kind: Service
metadata:
name: mynginx
labels:
name: mynginx
spec:
type: NodePort
ports:
- name: mynginx
port: 80
protocol: TCP
targetPort: 80
nodePort: 8888
selector:
name: mynginx
I can create deployment successfully, but failed to create service, please see snapshot below:
Can anyone tell me what’s happening here? Thanks.