Giter Club home page Giter Club logo

certified-kubernetes-administrator's People

Contributors

abishekk06 avatar vkharge avatar zealvora avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

certified-kubernetes-administrator's Issues

Pod AntiAffinity with PodAffinity + NotIn does not work

Context: video 47 from CKA course (Pod Affinity and Pod Anti-Affinity). Code use to produce pod antiaffinity.

Using this code (PodAffinity + NotIn to achieve PodAntiAffinity) does not work for me. The pod is scheduled on the same node as frontend app. Label app=frontend is present on frontend app.

$ kubectl get pods -o wide --show-labels
NAME       READY   STATUS    RESTARTS   AGE   IP            NODE                   NOMINATED NODE   READINESS GATES   LABELS
frontend   1/1     Running   0          86m   10.244.1.47   pool-axe79dmr0-8or0s   <none>           <none>            app=frontend,run=frontend
$ md5sum podaffinity-required.yaml 
8e217e52a432bee34d1aab01226d393c  podaffinity-required.yaml
$ kubectl apply -f podaffinity-required.yaml 
pod/kplabs-pod-affinity created
$ kubectl get pods -o wide              
NAME                  READY   STATUS    RESTARTS   AGE   IP            NODE                   NOMINATED NODE   READINESS GATES
frontend              1/1     Running   0          87m   10.244.1.47   pool-axe79dmr0-8or0s   <none>           <none>
kplabs-pod-affinity   1/1     Running   0          11s   10.244.1.3    pool-axe79dmr0-8or0s   <none>           <none>

But using PodAntiAffinity + In does the trick:

$ kubectl delete -f podaffinity-required.yaml
pod "kplabs-pod-affinity" deleted
$ cat podantiaffinity-required.yaml 
apiVersion: v1
kind: Pod
metadata:
  name: kplabs-pod-affinity
spec:
  affinity:
    podAntiAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
      - labelSelector:
          matchExpressions:
          - key: app
            operator: In
            values:
            - frontend
        topologyKey: kubernetes.io/hostname
  containers:
  - name: pod-affinity
    image: nginx
$ kubectl apply -f podantiaffinity-required.yaml 
pod/kplabs-pod-affinity created
$ kubectl get pods -o wide
NAME                  READY   STATUS    RESTARTS   AGE   IP             NODE                   NOMINATED NODE   READINESS GATES
frontend              1/1     Running   0          89m   10.244.1.47    pool-axe79dmr0-8or0s   <none>           <none>
kplabs-pod-affinity   1/1     Running   0          5s    10.244.0.191   worker-node-8ouvr      <none>           <none>

Other user also had this problem. I'm using the Digital Ocean managed kuberentes created two days ago.

Weave : issue

I am running two worker nodes and by running weave I am getting following error:

Events:
  Type     Reason     Age                    From               Message
  ----     ------     ----                   ----               -------
  Normal   Pulled     4m16s                  kubelet, worker-1  Container image "docker.io/weaveworks/weave-npc:2.6.0" already present on machine
  Normal   Created    4m16s                  kubelet, worker-1  Created container
  Normal   Started    4m16s                  kubelet, worker-1  Started container
  Normal   Pulled     3m45s (x2 over 4m17s)  kubelet, worker-1  Container image "docker.io/weaveworks/weave-kube:2.6.0" already present on machine
  Normal   Created    3m45s (x2 over 4m16s)  kubelet, worker-1  Created container
  Normal   Started    3m45s (x2 over 4m16s)  kubelet, worker-1  Started container
  Warning  Unhealthy  3m24s (x6 over 4m14s)  kubelet, worker-1  Readiness probe failed: Get http://127.0.0.1:6784/status: dial tcp 127.0.0.1:6784: connect: connection refused
  Warning  BackOff    3m14s                  kubelet, worker-1  Back-off restarting failed container
  Normal   Scheduled  74s                    default-scheduler  Successfully assigned kube-system/weave-net-9nkg7 to worker-1

Kinldy let me know where I am going wrong

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.