hasura / gitkube

Build and deploy docker images to Kubernetes using git push
Apache License 2.0
3.81k stars 207 forks source link

remoteUrl not created #104

Closed vanhumbeecka closed 5 years ago

vanhumbeecka commented 5 years ago

I'm following the examples (mono-repo) from gitkube for trying this out. After setting all parameters in a remote.yaml file, I cannot seem to generate a remote git url. The process of gitkube remote create -f remote.yml just keeps hanging for a while, and then completes without a remoteUrl or error response. Checking the status also yields empty strings for remoteUrl and remoteUrlDesc.

I'm using gitkube (configured as loadbalancer) with EKS. kubectl version gives

Client Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.0", GitCommit:"0ed33881dc4355495f623c6f22e7dd0b7632b7c0", GitTreeState:"clean", BuildDate:"2018-09-28T15:20:58Z", GoVersion:"go1.11", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"10+", GitVersion:"v1.10.3-eks", GitCommit:"58c199a59046dbf0a13a387d3491a39213be53df", GitTreeState:"clean", BuildDate:"2018-09-21T21:00:04Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

Any suggestions what I can try to get a remote git url?

tirumaraiselvan commented 5 years ago

@vanhumbeecka What is the gitkube version ? gitkube version

Also can you see if gitkubed svc has a proper loadbalancer ip ? kubectl get svc -n kube-system

vanhumbeecka commented 5 years ago

gitkube version: v0.3.0 kubectl get svc -n kube-system:

NAME       TYPE           CLUSTER-IP      EXTERNAL-IP                                                              PORT(S)         AGE
gitkubed   LoadBalancer   10.100.113.37   a9568d91ae99d11e8ba7c02f2ae16eb8-677891630.eu-west-1.elb.amazonaws.com   22:30032/TCP    1h
kube-dns   ClusterIP      10.100.0.10     <none>                                                                   53/UDP,53/TCP   4h
tirumaraiselvan commented 5 years ago

Looks like everything is fine. Can you send me the output of kubectl get remote <remote-name> -o yaml ?

vanhumbeecka commented 5 years ago

sure.

apiVersion: v1
items:
- apiVersion: gitkube.sh/v1alpha1
  kind: Remote
  metadata:
    clusterName: ""
    creationTimestamp: 2018-11-16T14:02:24Z
    generation: 1
    name: myremote
    namespace: default
    resourceVersion: "19187"
    selfLink: /apis/gitkube.sh/v1alpha1/namespaces/default/remotes/myremote
    uid: 3e1cea97-e9a8-11e8-a0da-06383870ab68
  spec:
    authorizedKeys:
    - |
      ssh-rsa <removed here>
    deployments:
    - containers:
      - dockerfile: microservices/nginx/Dockerfile
        name: www
        path: microservices/nginx
      name: www
    manifests:
      helm: {}
      path: manifests
    registry:
      credentials:
        secretKeyRef:
          key: ""
        secretRef: regsecret2
      url: 798312675893.dkr.ecr.eu-west-1.amazonaws.com
  status:
    remoteUrl: ""
    remoteUrlDesc: ""
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""
vanhumbeecka commented 5 years ago

Like the documenation said, I created some container repositories on AWS in advance, matching the naming convention specified, so default-myremote-default.www-www

vanhumbeecka commented 5 years ago

And here is the output of gitkube remote list

NAME         URL     ERROR
myremote
tirumaraiselvan commented 5 years ago

Okay. I think something is up with the controller. Can you check the statue of gitkube-controller pod?

kubectl get pods -n kube-system. Look for gitkube-controller and please post the statue and logs here.

vanhumbeecka commented 5 years ago

Ok, forgot to check that, indeed the controller is in a pending state...

output of kubectl get pods -n kube-system:

NAME                                  READY   STATUS    RESTARTS   AGE
gitkube-controller-85c8fbf8cc-qgqvs   0/1     Pending   0          1h
gitkubed-5c5c774d9b-49zx5             0/1     Pending   0          1h
kube-dns-fcd468cb-jvw5k               0/3     Pending   0          4h
tirumaraiselvan commented 5 years ago

Seems like for some reason everything is pending. You can see the details by kubectl get pods <pod-name> -n kube-system -o yaml

vanhumbeecka commented 5 years ago

Ok, checking the state of the kube-dns pod, i noticed these events:

Events:
  Type     Reason            Age                     From               Message
  ----     ------            ----                    ----               -------
  Warning  FailedScheduling  2m8s (x961 over 4h43m)  default-scheduler  no nodes available to schedule pods

I assumed eks with have a sensible default on startup?

vanhumbeecka commented 5 years ago

anyway, thank you for looking into it. The problem is in the cluster itself, so my bad.