LoginSignup
2
1

More than 5 years have passed since last update.

JenkinsのSlaveからのjnlp連携を非LB経由で行う

Last updated at Posted at 2016-06-24

ロードバランサー(LB)の先にあるjenkinsサーバにjnlp接続しようとすると、LBでiptableなどでのポートフォワードが必要になる。
ローカルネットワークの場合、直接jenkinsサーバに接続した方が楽なのでjnplファイルにargumentを追加して直接アドレスを指定する方法

jenkinsの設定でも可能なのだけど、ここでは直接jnlpファイルを編集します。

jenkinsからダウンロードしたslave-agent.jnlpをテキストエディタで開き
application-descにargument -tunnel と jenkinsサーバのIPアドレス:PORTを追加する。

※ちなみに、jnlpファイルは、1行でないと動かないので嵌らないように!

slave-agent.jnlp
<jnlp spec="1.0+" codebase="https://myjenkins.com/computer/slave01/">
    <information>
        <title>
            Agent for slave01
        </title>
        <vendor>
            Jenkins project
        </vendor>
        <homepage href="https://jenkins-ci.org/">
        </homepage>
    </information>
    <security>
        <all-permissions>
        </all-permissions>
    </security>
    <resources>
        <j2se version="1.7+">
            <jar href="https://myjenkins.com/jnlpJars/remoting.jar">
                <property name="hudson.showWindowsServiceInstallLink" value="true">
                </property>
            </jar>
        </j2se>
    </resources>
    <application-desc main-class="hudson.remoting.jnlp.Main">
        <argument>
            23ebc8e1da6d111da63b3c9770cb1ea79136cf45e937fd9815c188cacbbfe9c4
        </argument>
        <argument>
            slave01
        </argument>
        <argument>
            -url
        </argument>
        <argument>
            https://myjenkins.com/
        </argument>
        <argument>
            -tunnel
        </argument>
        <argument>
            10.102.55.101:9000
        </argument>
    </application-desc>
</jnlp>
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1