aks can't create a kubernetes replica set

4/5/2018

When trying to create a kubernetes replica set from a yaml file, then I always get this error on AKS:

kubectl create -f kubia-replicaset.yaml error: unable to recognize "kubia-replicaset.yaml": no matches for apps/, Kind=ReplicaSet

I tried it with several different files and also the samples from the K8s documentation, but all result in this failure. Creating Pods and RCs works

below is the yaml file:

apiVersion: apps/v1beta2
kind: ReplicaSet
metadata:
  name: kubia
spec:
  replicas: 3
  selector:
    matchLabels:
      app: kubia
  template:
    metadata:
      labels:
        app: kubia
    spec:
      containers:
      - name: kubia
        image: luksa/kubia
-- lukaspman
azure
azure-aks
kubernetes

2 Answers

11/19/2019

Change apps/v1beta2 to apps/v1 works for me.

-- user805981
Source: StackOverflow

4/5/2018

You are supposed advised to use deployments now:

A Deployment controller provides declarative updates for Pods and ReplicaSets.

You describe a desired state in a Deployment object, and the Deployment controller changes the actual state to the desired state at a controlled rate. You can define Deployments to create new ReplicaSets, or to remove existing Deployments and adopt all their resources with new Deployments.

And this piece:

Kubectl rolling update updates Pods and ReplicationControllers in a similar fashion. But Deployments are recommended, since they are declarative, server side, and have additional features, such as rolling back to any previous revision even after the rolling update is done.

Also, take a look here

-- 4c74356b41
Source: StackOverflow