title: Kubernetes + calico + replicaSet
body: <p>So I found myself in a pretty sticky situation. I'm trying to create a simple replicaSet, but unfortunately I ran into some problems with the calico.</p>
  
  <p>I have 2 VM running on OracleVM. I have them configured to use enp0s8 interface. The IP of the master node is 192.168.56.2 and the worker node's ip is 192.168.56.3</p>
  
  <p>Here is what I'm doing in Kubernetes. First I'm creating the kubernetes master node:</p>
  
  <pre><code>kubeadm init --pod-network-cidr=192.168.0.0/16 --apiserver-advertise-address=192.168.56.2
  </code></pre>
  
  <p>after successfuly initialzing I'm running:</p>
  
  <pre><code>export KUBECONFIG=/etc/kubernetes/admin.conf
  </code></pre>
  
  <p>Now I'm creating the POD network by running:</p>
  
  <pre><code>kubectl apply -f https://docs.projectcalico.org/v3.11/manifests/calico.yaml
  </code></pre>
  
  <p>after that I'm joining from the worker node successfully. Whenever I start the replica with:</p>
  
  <p>*** edit: I don't have to create the replicaset to obtain the same result of the calico-node creation getting stuck</p>
  
  <pre><code>kubectl create -f replicaset-definition.yml
  </code></pre>
  
  <p>in which the yml looks like this:</p>
  
  <pre><code>kind: ReplicaSet
  metadata:
    name: myapp-replicaset
    labels:
      app: myapp
      type: front-end
  spec:
    template:
      metadata:
        name: myapp-pod
        labels:
          app: myapp
          type: front-end
      spec:
        containers:
          - name: nginx-container
            image: nginx
    replicas: 2
    selector:
      matchLabels:
        app: myapp
  </code></pre>
  
  <p>I'm getting a new calico-node created which eventually will get stuck</p>
  
  <pre><code>calico-node-mcb5g                          0/1     Running   6          8m58s
  calico-node-t9p5n                          1/1     Running   0          12m
  </code></pre>
  
  <p>If I run 
  <code>kubectl logs -n kube-system calico-node-mcb5g -f</code> 
  on it I get the following logs:</p>
  
  <pre><code>2020-03-18 14:45:40.585 [INFO][8] startup.go 275: Using NODENAME environment for node name
  2020-03-18 14:45:40.585 [INFO][8] startup.go 287: Determined node name: kubenode1
  2020-03-18 14:45:40.587 [INFO][8] k8s.go 228: Using Calico IPAM
  2020-03-18 14:45:40.588 [INFO][8] startup.go 319: Checking datastore connection
  2020-03-18 14:46:10.589 [INFO][8] startup.go 334: Hit error connecting to datastore - retry error=Get https://10.96.0.1:443/api/v1/nodes/foo: dial tcp 10.96.0.1:443: i/o timeout
  2020-03-18 14:46:41.591 [INFO][8] startup.go 334: Hit error connecting to datastore - retry error=Get https://10.96.0.1:443/api/v1/nodes/foo: dial tcp 10.96.0.1:443: i/o timeout
  </code></pre>
  
  <p>I've tried to configure the calico.yml and added the following line in env:</p>
  
  <pre><code>- name: IP_AUTODETECTION_METHOD
    value: "interface=enp0s8"
  </code></pre>
  
  <p>but the result is still the same.</p>
  
  <p>Thank you so much for reading this and if you have any advice I will be sooo grateful!!!</p>