Amit Ranjan
Amit Ranjan

Reputation: 205

Unable to deploy the image in the kubernetes (AWS)

I am stuck in the last moment , cannot figure out the mistake , everything is working fine , but while deploying the image on the cluster getting the error:

The image is in the docker hub , from the aws , i used docker login , provided the credential also .

sudo kops validate cluster --state=s3://kops-storage-54321 -o yaml

output :

Using cluster from kubectl context: tests.k8s.local

nodes:
- hostname: ip-172-20-40-124.us-east-2.compute.internal
  name: ip-172-20-40-124.us-east-2.compute.internal
  role: master
  status: "True"
  zone: us-east-2a
- hostname: ip-172-20-112-165.us-east-2.compute.internal
  name: ip-172-20-112-165.us-east-2.compute.internal
  role: node
  status: "True"
  zone: us-east-2c
- hostname: ip-172-20-60-168.us-east-2.compute.internal
  name: ip-172-20-60-168.us-east-2.compute.internal
  role: node
  status: "True"
  zone: us-east-2a

Docker Login :

sudo docker login

Authenticating with existing credentials...
WARNING! Your password will be stored unencrypted in /home/ubuntu/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded

while deploying the image getting the error:

Command:

ubuntu@ip-172-31-30-176:~$  sudo kubectl create deployment magicalnginx --image=amitranjan007/magicalnginx

Error:

error: no matches for extensions/, Kind=Deployment

Upvotes: 0

Views: 73

Answers (1)

Arghya Sadhu
Arghya Sadhu

Reputation: 44657

You can check which apis support current Kubernetes object using

$ kubectl api-resources | grep deployment
deployments                       deploy       apps                           true         Deployment

This means that only apiVersion with apps is correct for Deployments (extensions is not supporting Deployment) from kubernetes version 1.16.

Change apiVersion to apps/v1 in deployment yaml.

Upvotes: 1

Related Questions