Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to push to repo (ssh issue?) #128

Open
rschwabco opened this issue Jun 10, 2020 · 3 comments
Open

Unable to push to repo (ssh issue?) #128

rschwabco opened this issue Jun 10, 2020 · 3 comments

Comments

@rschwabco
Copy link

rschwabco commented Jun 10, 2020

After following the setup instructions:

kubectl create -f https://raw.githubusercontent.com/hasura/gitkube/master/manifests/gitkube-setup.yaml

#expose gitkubed service
kubectl --namespace kube-system expose deployment gitkubed --type=LoadBalancer --name=gitkubed

I've set this repo up:

apiVersion: gitkube.sh/v1alpha1
kind: Remote
metadata:
  name: my-app-remote
  namespace: default
spec:

# Insert ssh-keys for allowing users to git push
  authorizedKeys:
  - |
    "ssh-rsa AAAA........"  #content of ~/.ssh/id_rsa.pub 

# Provide registry details: https://github.com/hasura/gitkube/blob/master/docs/registry.md
  registry:
    url: "services.azurecr.io"
    credentials:
      secretRef: services-regsecret                # Name of docker-registry secret

# Define deployment rules
  deployments:
  - name: my-app                             # Name of K8s deployment which is updated on git push
    containers: 
    - name: my-app                           # Name of container in the deployment which is built during git push
      path: .                   # Docker build context path in the git repo
      dockerfile: ./Dockerfile  # Location of Dockerfile for the source code

For

kubectl get remote my-app-remote -o yaml

I get

ssh://default-my-app-remote@40.64.64.125/~/git/default-my-app-remote

I then set up the remote:

git remote add release ssh://default-my-app-remote@40.64.64.125/~/git/default-my-app-remote

When I push, it failes with

The authenticity of host '40.64.64.125 (40.64.64.125)' can't be established.
ECDSA key fingerprint is SHA256:lOqGRBz/OyFYKwkUbrZrWSAYqWPjPGp1x8moUj9ci18.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

What could possibly be going wrong?

@shahidhk
Copy link
Member

shahidhk commented Jun 12, 2020

Can you edit the SSH key to remove the quotes?

  - |
    "ssh-rsa AAAA........"  #content of ~/.ssh/id_rsa.pub

should be

  - ssh-rsa AAAA........

on a single line

@shahidhk
Copy link
Member

I you wanna do multiline, use

  - |
      ssh-rsa AAAA........

Indentation is important

@platy
Copy link

platy commented Sep 19, 2020

I had the same issue, it wasn't anything wrong in the yaml. It turned out that gitkubed is not refreshed when adding or changing remotes, so if you add an authorized key you need to restart gitkubed before you can connect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants