V1.2 Create Service Issue

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.

Sorry, issue addressed, I defined with wrong nodePort range.

hi,i have the same wrongs,i want set nodeport=80,but filed,please tell the ditails about how to resolve this,thanks!

default nodeport range is 30000~32767, you cannot define 80 here.