Kubernetes集群上的Gitlab-无法使用git克隆或推送

我已经在我的Linode Kubernetes集群上安装了gitlab,并且UI正常工作。但是我无法克隆/推送任何存储库,因为ssh访问失败。

git clone ssh://git@gitlab.example.com:6022/v2o/prova.git
Clone in 'prova' in corso...
git@example.com: Permission denied (publickey,password).

我已经创建了SSH密钥对,并在Gitlab上添加了公共密钥对,但是什么也没有。

我已经阅读了互联网上的一些建议,并尝试运行ssh -Tv ssh://git@gitlab.example.com:6022

debug1: Will attempt key: /Users/v20/.ssh/id_ed25519 ED25519 SHA256:1246872361472618746238bdhahdahsdhjfa explicit
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_accEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/v2o/.ssh/id_ed25519 ED25519 SHA256:5fTy/hjLhfZ7xvLQmkxxjdddMNFiIV7auC2/U7nxsEo explicit
debug1: Authentications that can continue: publickey,password
debug1: No more authentication methods to try.
git@gitlab.example.com: Permission denied (publickey,password).

它拾取了正确的密钥(/Users/v20/.ssh/id_ed25519),但看起来还是无法连接。

注意1 ”我使用了暴露6022:22端口的NodeBalancer-我不知道此配置是否正确,但在Linode上已启动,所以我猜是这样

注意2 如果我在跑步者任务窗格中执行,则会得到未知版本的git,redis和go。使用GO可以正常使用,但不知道使用git / redis。

git@gitlab-task-runner-7869d8d675-k4s4l:/$ gitlab-rake gitlab:env:info

System information
System:
Current User:   git
Using RVM:      no
Ruby Version:   2.6.6p146
Gem Version:    2.7.10
Bundler Version:1.17.3
Rake Version:   12.3.3
Redis Version:  unknown
Git Version:    unknown
Sidekiq Version:5.2.9
Go Version:     unknown

GitLab information
Version:        13.5.3
Revision:
Directory:      /srv/gitlab
DB Adapter:     PostgreSQL
DB Version:     13.0
URL:            https://gitlab.example.com
HTTP Clone URL: https://gitlab.example.com/some-group/some-project.git
SSH Clone URL:  git@gitlab.example.com:some-group/some-project.git
Using LDAP:     no
Using Omniauth: no

GitLab Shell
Version:        13.11.0
Repository storage paths:
- default:      /var/opt/gitlab/repo
GitLab Shell path:              /home/git/gitlab-shell
Git:            /usr/bin/git

注意3 上面消息中的git路径是错误的,这可能是一个问题,但是我不知道如何更改它:/

mimiyou2004 回答:Kubernetes集群上的Gitlab-无法使用git克隆或推送

我设法解决了这个问题。

  1. 我需要在GitLab配置(values.yaml)中指定外壳将在高端口3xxxx上公开,所以我添加了这一部分:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.barcodescanner">


<uses-feature
    android:name="android.hardware.camera"
    android:required="true" />

<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.VIBRATE" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/Theme.BarcodeScanner">
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <meta-data android:name="com.google.android.gms.vision.DEPENDENCIES" android:value="barcode"></meta-data>
</application>
  1. 然后我需要设置另一个变量(在同一文件中)<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <SurfaceView android:layout_width="match_parent" android:layout_height="300dp" android:id="@+id/camerapreview" android:layout_centerInParent="true" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/textView" android:layout_below="@+id/camerapreview" android:layout_marginTop="20dp" android:text="Please focus on QR code" android:textSize="18sp" android:gravity="center"/>

  2. 节点平衡器需要位于端口22-> 32022

...最终它像魅力一样起作用!

本文链接:https://www.f2er.com/1253237.html

大家都在问