2017-11-23 25 views
0

私は、提供されたOpenshift PaaS展開Grafanaアプリイメージを使用しています。展開時に自動的に開閉棒を変更する

Grafanaにプラグインを追加したいのは、特定のファイルをファイルシステムに追加するか、grafana-cliコマンドを呼び出すことです。

oc CLIを使用してアクセスすることで、1つの極で手動で行うことができました。私が知らないことは、それを永続的にする方法です。私はOpenshiftポールがインスタンス化されるたびに適用することを希望します。私はそのためにカスタムイメージを提供する以外の方法は見つけませんでした。

既存の定義済みイメージにファイルを追加する方法はありますか? または、展開後にポールでコマンドを起動しますか?ポストデプロイメントフックを試しましたが、ファイルシステムがまだ存在しないようです(または、このフックの使用方法がわかりません)

+0

ちょうどメモ:私はOpenshiftについて何も知らないが、私はあなたがGrafanaドッカーハブイメージを使用していると仮定している。ファイルを追加したり、cliを実行してプラグインをインストールする代わりに、環境変数を使用してインストールすることができます。 dockerhubドキュメントの 'Grafana 3のプラグインのインストール'セクションを参照してください:https://hub.docker.com/r/grafana/grafana/ –

答えて

0

デプロイ後のライフサイクルフックは、独自のファイルシステム、アプリケーションのコンテナではありません。 postStartフックを見たいと思っています。

$ oc explain dc.spec.template.spec.containers.lifecycle 
RESOURCE: lifecycle <Object> 

DESCRIPTION: 
    Actions that the management system should take in response to container 
    lifecycle events. Cannot be updated. 

    Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted. 

FIELDS: 
    postStart <Object> 
    PostStart is called immediately after a container is created. If the 
    handler fails, the container is terminated and restarted according to its 
    restart policy. Other management of the container blocks until the hook 
    completes. More info: 
    http://kubernetes.io/docs/user-guide/container-environment#hook-details 

    preStop <Object> 
    PreStop is called immediately before a container is terminated. The 
    container is terminated after the handler completes. The reason for 
    termination is passed to the handler. Regardless of the outcome of the 
    handler, the container is eventually terminated. Other management of the 
    container blocks until the hook completes. More info: 
    http://kubernetes.io/docs/user-guide/container-environment#hook-details 
関連する問題