I am using Azure devops for regulation CI/CD in my project , i have a kubernetes cluster running through aks(azure kubernetes service) , i have used azure repo and everything and , every required file(viz. azure-pipeline file and services and deployment) is auto generated and i haven't altered anything in it , it builds nicely , but it fails in the deployment phase , I encounter this error as shown below ,
Error:
/usr/bin/kubectl apply -f /home/vsts/work/_temp/bookstore_1570774284000,/home/vsts/work/_temp/bookstore_1570774284001 --namespace default
error when retrieving current configuration of:
Resource: "apps/v1beta1, Resource=deployments", GroupVersionKind: "apps/v1beta1, Kind=Deployment"
Name: "alesblaze/bookstore", Namespace: "default"
Object: &{map["apiVersion":"apps/v1beta1" "kind":"Deployment" "metadata":map["annotations":map["kubectl.kubernetes.io/last-applied-configuration":""] "name":"alesblaze/bookstore" "namespace":"default"] "spec":map["replicas":'\x01' "template":map["metadata":map["labels":map["app":"alesblaze/bookstore"]] "spec":map["containers":[map["image":"***/alesblaze/bookstore" "name":"alesblaze/bookstore" "ports":[map["containerPort":'\u1f90']]]] "imagePullSecrets":[map["name":"bookstoreappacrd0a8-auth"]]]]]]}
from server for: "/home/vsts/work/_temp/bookstore_1570774284000": invalid resource name "alesblaze/bookstore": [may not contain '/']
error when retrieving current configuration of:
Resource: "/v1, Resource=services", GroupVersionKind: "/v1, Kind=Service"
Name: "alesblaze/bookstore", Namespace: "default"
Object: &{map["apiVersion":"v1" "kind":"Service" "metadata":map["annotations":map["kubectl.kubernetes.io/last-applied-configuration":""] "name":"alesblaze/bookstore" "namespace":"default"] "spec":map["ports":[map["port":'\u1f90']] "selector":map["app":"alesblaze/bookstore"] "type":"LoadBalancer"]]}
from server for: "/home/vsts/work/_temp/bookstore_1570774284001": invalid resource name "alesblaze/bookstore": [may not contain '/']
##[error]error when retrieving current configuration of:
Resource: "apps/v1beta1, Resource=deployments", GroupVersionKind: "apps/v1beta1, Kind=Deployment"
Name: "alesblaze/bookstore", Namespace: "default"
Object: &{map["apiVersion":"apps/v1beta1" "kind":"Deployment" "metadata":map["annotations":map["kubectl.kubernetes.io/last-applied-configuration":""] "name":"alesblaze/bookstore" "namespace":"default"] "spec":map["replicas":'\x01' "template":map["metadata":map["labels":map["app":"alesblaze/bookstore"]] "spec":map["containers":[map["image":"***/alesblaze/bookstore" "name":"alesblaze/bookstore" "ports":[map["containerPort":'\u1f90']]]] "imagePullSecrets":[map["name":"bookstoreappacrd0a8-auth"]]]]]]}
from server for: "/home/vsts/work/_temp/bookstore_1570774284000": invalid resource name "alesblaze/bookstore": [may not contain '/']
error when retrieving current configuration of:
Resource: "/v1, Resource=services", GroupVersionKind: "/v1, Kind=Service"
Name: "alesblaze/bookstore", Namespace: "default"
Object: &{map["apiVersion":"v1" "kind":"Service" "metadata":map["annotations":map["kubectl.kubernetes.io/last-applied-configuration":""] "name":"alesblaze/bookstore" "namespace":"default"] "spec":map["ports":[map["port":'\u1f90']] "selector":map["app":"alesblaze/bookstore"] "type":"LoadBalancer"]]}
from server for: "/home/vsts/work/_temp/bookstore_1570774284001": invalid resource name "alesblaze/bookstore": [may not contain '/']
Finishing: Deploy to Kubernetes cluster
Edit :
Service.yaml
apiVersion: v1
kind: Service
metadata:
name: alesblaze/bookstore
spec:
type: LoadBalancer
ports:
- port: 8080
selector:
app: alesblaze/bookstore
deployment.yaml
apiVersion : apps/v1beta1
kind: Deployment
metadata:
name: alesblaze/bookstore
spec:
replicas: 1
template:
metadata:
labels:
app: alesblaze/bookstore
spec:
containers:
- name: alesblaze/bookstore
image: bookstoreappacr.azurecr.io/alesblaze/bookstore
ports:
- containerPort: 8080
Kubernetes version : 1.13.10