This Yaml is Wrong Can you provide the correct yaml, the intending are wrong. Try Below YAML
apiVersion: extensions/v1beta1 kind: Deployment metadata: name: kubdemo1api labels: name: kubdemo1api spec: replicas: 1 strategy: rollingUpdate: maxSurge: 1 maxUnavailable: 1 type: RollingUpdate minReadySeconds: 30 selector: matchLabels: app: kubdemo1api template: metadata: labels: app: kubdemo1api version: "1.0" tier: backend spec: containers: - name: kubdemo1api image: nginx resources: requests: cpu: 100m memory: 100Mi ports: - containerPort: 80 livenessProbe: httpGet: path: / port: 80 readinessProbe: httpGet: path: / port: 80 initialDelaySeconds: 30 timeoutSeconds: 10 --- apiVersion: v1 kind: Service metadata: name: azkubdemoapi1 spec: ports: - port: 80 selector: app: kubdemo1api type: LoadBalancer