0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Operatorのアイコンを設定する

Last updated at Posted at 2021-10-02

目的

過去記事で、自作のAnsible Operatorをクラスタにインストールし、OpenShift Webコンソールに表示することができました。

第1回

第2回

image.png

しかし、アイコンが表示されていないことに気づいたので、今回はアイコンを付けてみます。

手順

アイコンデータの準備

アイコンの仕様は不明なので、とりあえず書いてPNG形式で保存します。

BASE64エンコード

データをBASE64エンコードします。

$ base64 -w 0 icon.png
iVBORw0KGgoAAAANSUhEUgAAAoAAAAKACAIAAACDr150AAAAAXNSR0IArs4c6QAAAARn...

ClusterServiceVersionの変更

アイコンデータはClusterServiceVersionに記述します。

config/manifests/bases/hello-ansible-operator.clusterserviceversion.yaml
...
spec:
  apiservicedefinitions: {}
  customresourcedefinitions: {}
  description: An example of Ansible Operator
  displayName: Hello Operator
  icon:
  - base64data: iVBORw0KGgoAAAANSUhEUgAAAoAAAAKACAIAAACDr150AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv...
    mediatype: image/png
...

バージョンの更新

せっかくなのでOperatorのバージョンも上げます。

Makefile
VERSION ?= 0.0.2  # 0.0.1から変更

ビルド&プッシュ

$ make docker-build docker-push
$ make bundle bundle-build bundle-push

Operatorの更新

前回記事の状態からクリーンアップをしていない、つまり0.0.1がインストール済とします。Operatorを更新するには下記のようにbuild-upgradeオプションを使用します。

$ operator-sdk run bundle-upgrade jp.icr.io/teruq/hello-ansible-operator-bundle:v0.0.2 --pull-secret-name all-icr-io -n qiita-operators
INFO[0004] Found existing subscription with name hello-ansible-operator-v0-0-1-sub and namespace qiita-operators
INFO[0004] Found existing catalog source with name hello-ansible-operator-catalog and namespace qiita-operators
INFO[0018] Successfully created registry pod: jp-icr-io-teruq-hello-ansible-operator-bundle-v0-0-2
INFO[0018] Updated catalog source hello-ansible-operator-catalog with address and annotations
INFO[0018] Deleted previous registry pod with name "jp-icr-io-teruq-hello-ansible-operator-bundle-v0-0-1"
INFO[0055] Approved InstallPlan install-9wkck for the Subscription: hello-ansible-operator-v0-0-1-sub
INFO[0055] Waiting for ClusterServiceVersion "qiita-operators/hello-ansible-operator.v0.0.2" to reach 'Succeeded' phase
INFO[0055]   Waiting for ClusterServiceVersion "qiita-operators/hello-ansible-operator.v0.0.2" to appear
INFO[0056]   Found ClusterServiceVersion "qiita-operators/hello-ansible-operator.v0.0.2" phase: Pending
INFO[0057]   Found ClusterServiceVersion "qiita-operators/hello-ansible-operator.v0.0.2" phase: Installing
INFO[0071]   Found ClusterServiceVersion "qiita-operators/hello-ansible-operator.v0.0.2" phase: Succeeded
INFO[0071] Successfully upgraded to "hello-ansible-operator.v0.0.2"

確認

Webコンソールを見るとアイコンが表示されました。

image.png

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?