Más contenido relacionado La actualidad más candente (20) Similar a Machine configoperatorのちょっとイイかもしれない話 (20) Machine configoperatorのちょっとイイかもしれない話 2. 自己紹介
Machine Config Operator のちょっとイイかもしれない話
初めての執筆活動
氏名:荒木 俊博
テクニカルセールス本部
クラウドソリューション アーキテクト部
ソリューションアーキテクト /Cloud Architect
主な特徴
IT業界では、2000年よりインフラエンジニアとして様々な経験
OpenStack がきっかけで、Open Source の文化や雰囲気に強く弾かれて
Red Hat では、
クラウド製品を中心に、コンサルタントとソリューションアーキテクトを経験
一言
インフラSEでの経験やSIの知識を武器に、製品を的確にお客様の課題で訴求できるこ
とを心掛けております。
2
3. 3
Key Topic :
CoreOS
Machine Config Operator
Machine API
今日のお話:
OpenShift Platformの管理性を向
上させる機能のお話です。
Machine Config Operator のちょっとイイかもしれない話
5. Machine Config Operator
5
OpenShift 環境下のノードOSレベルの設定適用は、 MCO を介して行
われます。
● OSをプロビジョニングした後の設定を提供
○ SSH keys
○ Files
○ systemd units
● 設定は ConfigMaps/CRDs として配置される
○ oc create -f test.yaml
○ oc get machineconfigs --watch
● ノードのあるべき状態を維持
OpenShift 環境において、CoreOS に対して、Kubernetes
ネイティブ な構成(宣言型)を提供する仕組み
# test.yaml
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: worker
name: test-file
spec:
config:
storage:
files:
- contents:
source: data:,hello%20world%0A
verification: {}
filesystem: root
mode: 420
path: /etc/test
Machine Config Operator のちょっとイイかもしれない話
6. Machine Config Operator
6
以下の様な操作を機能的に提供します。
● Cordin / uncordins nodes
● Drain pods
● Apply OS updates
● Apply config changes
● Apply changes for systemd units
● Reboot
OpenShift の 運用管理フェーズ の設定変更やアップデート/アップグレードで機能
1. ノード状態の検証
2. クラスターレベルのポリシー&状態
の検証
3. クラスター全体への変更の適用
OS_VERSION
= [hash]
!=
MaxUnavailable
= 1
Machine Config Operator のちょっとイイかもしれない話
7. MCOの必要性
7
● 大規模環境の管理性の向上
○ OCP は、通常6 ノード から(小くはない)
● Kubernetes 環境としての操作の一貫性
○ 組み合わせるテクノロジーのギャップを吸収することで、管理者のケース バイ ケースを低減
...etc 色々理由は考えられますが、、、
そもそも、CoreOS を組み込みたかった。
大規模でも
OK!
MCO
LOVE!
OpenShift Cluster
Machine Config Operator のちょっとイイかもしれない話
8. RHEL CoreOS
8 Copyright 2019 Red Hat K.K
OpenShiftクラスタのための
イミュータブルな基盤
ベアメタル/クラウド環境での
Ignitionベースのホスト構成
自動Over-the-airアップデート
攻撃可能な入口を削減
コンテナ実行に最適化
最小構成のLinuxディストロ
Machine Config Operator のちょっとイイかもしれない話
9. Customizable OS Immutable container host
BENEFITS
WHEN TO USE
• Industry standard security
• 10+ year enterprise lifecycle
• High performance on any infrastructure
• Customizable and compatible with wide
ecosystem of partner solutions
• Increased container host security
• Self-managing, over-the-air updates
• Optimized performance on popular
infrastructure
• Immutable and tightly integrated with
OpenShift
When customization and integration with
additional solutions is required
When cloud-native, rolling updates are top
priority
RHEL 8: A SINGLE OPERATING SYSTEM
2 DEPLOYMENT OPTIONS
Machine Config Operator のちょっとイイかもしれない話
10. {
"ignition": {
"config": {},
"timeouts": {},
"version": "2.1.0"
},
"passwd": {
"users": [
{
"name": "core",
"passwordHash": "$6$43y3tkl...",
"sshAuthorizedKeys": [
"key1"
]
}
]
},
"storage": {},
"systemd": {}
}
One Touch provisioning via Ignition
Machine generated; machine validated
Ignition applies a declarative node
configuration early in the boot process.
Unifies kickstart and cloud-init.
● Generated via openshift-install &
MCO
● Configures storage, systemd units,
users, & remote configs
● Executed in the initramfs
Machine Config Operator のちょっとイイかもしれない話
11. Transactional updates ensure that RHEL
CoreOS is never altered during runtime. Rather
it is booted directly into an always “known good”
version.
● Each OS update is versioned and tested as
an complete image.
● OS binaries (/usr) are read-only
● Updates encapsulated in container images
● file system and package layering available
for hotfixes and debugging
Transactional Updates via rpm-ostree
Versioning and Simplifying OS Updates
Machine Config Operator のちょっとイイかもしれない話
12. MCOコンポーネント
12
machine-config-operator … ノード設定に関する機能とCRD を提供するOperator
machine-config-server … OCPクラスターへのノード追加時に、ignitionを提供
machine-config-controller … 宣言型のアップグレードメカニズムの調整機能を提供
machine-config-daemon … マシン設定アップデートとその検証を提供
[toaraki-redhat.com@clientvm 0 ~/cluster-c2ab]$ oc get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
etcd-quorum-guard-56d489f899-4nwbn 1/1 Running 0 42h 10.0.137.119 ip-10-0-137-119.ap-southeast-1.compute.internal <none> <none>
etcd-quorum-guard-56d489f899-9xwms 1/1 Running 0 42h 10.0.159.185 ip-10-0-159-185.ap-southeast-1.compute.internal <none> <none>
etcd-quorum-guard-56d489f899-j4mf7 1/1 Running 0 42h 10.0.167.142 ip-10-0-167-142.ap-southeast-1.compute.internal <none> <none>
machine-config-controller-8cf5649dd-f6cwf 1/1 Running 0 42h 10.130.0.13 ip-10-0-137-119.ap-southeast-1.compute.internal <none> <none>
machine-config-daemon-5l9xd 1/1 Running 0 42h 10.0.159.185 ip-10-0-159-185.ap-southeast-1.compute.internal <none> <none>
machine-config-daemon-j4rsz 1/1 Running 0 42h 10.0.154.138 ip-10-0-154-138.ap-southeast-1.compute.internal <none> <none>
machine-config-daemon-rgh2x 1/1 Running 0 42h 10.0.167.142 ip-10-0-167-142.ap-southeast-1.compute.internal <none> <none>
machine-config-daemon-xmsll 1/1 Running 0 42h 10.0.137.119 ip-10-0-137-119.ap-southeast-1.compute.internal <none> <none>
machine-config-daemon-zzmgj 1/1 Running 0 42h 10.0.134.4 ip-10-0-134-4.ap-southeast-1.compute.internal <none> <none>
machine-config-operator-74d697b7f-mfcqt 1/1 Running 0 42h 10.130.0.4 ip-10-0-137-119.ap-southeast-1.compute.internal <none> <none>
machine-config-server-89jk2 1/1 Running 0 42h 10.0.167.142 ip-10-0-167-142.ap-southeast-1.compute.internal <none> <none>
machine-config-server-kg8z9 1/1 Running 0 42h 10.0.159.185 ip-10-0-159-185.ap-southeast-1.compute.internal <none> <none>
machine-config-server-xs67w 1/1 Running 0 42h 10.0.137.119 ip-10-0-137-119.ap-southeast-1.compute.internal <none> <none>
[toaraki-redhat.com@clientvm 0 ~/cluster-c2ab]$
Machine Config Operator のちょっとイイかもしれない話
13. MCO まとめ
13
MCOは、
● OpenShift 環境下のCoreOSノードに対する管理操作を提供
○ そもそもCoreOSはRHELとは異る管理インターフェース(Ignition)
○ Kube-Native な作法
○ 大規模になっても一貫性のあるシンプルな管理性を提供
実際のところ、運用管理の操作において、MCO
をそれほど意識することはないかも。
例えば、バージョンのアップデートは、
Cluster Version Operator がMCOを介して
行います。
MCO
OpenShift Cluster
CVO
任せられるな
ら楽チン!
Machine Config Operator のちょっとイイかもしれない話
14. Over-the-air Updates - Delivery Mechanism
For Hosted and on-prem Deployments
● Updates can be driven from either
cloud.openshift.com and/or the
Cluster Console
● All updates are delivered via
container images
● Auto-update support
● Manual updates will be supported
for disconnected environments
○ Tooling to automate updates will be
added in later release
○ Single source of content to mirror
Machine Config Operator のちょっとイイかもしれない話
18. Machine APIとは
18
Machine API は、
OCPが実行されるプラットフォームに依存せず、シンプルで、一貫性のある管理性を提供
具体的には、
● ノードの即時的なスケールイン/アウトをコマンドラインから可能に
● ノードのスケール調整そのものを自動化(autoscale)
● ノードのローリングアップデート
● ノードの自動リカバリ(OCP 4.2 では、ヘルスチェック機能のみTP)
Machine Config Operator のちょっとイイかもしれない話
26. 自動化の例えば...
26
OpenShift は、Cluster API の拡張である、Machine APIによって、環境のライフサイクルにまつわる様々
な管理を自動化している。
Machine APIは、環境上のノード(machine)の管理が一つの目的
Machine Config Operatorが提供されることによって、 ノードのOSに関する様々な操作にKube-Nativeを
実現。
IaaS は、ノードそのものをAPI経由で操作することが可能。
組み合わせる事によって、ノードに対するauto-scale や、auto-heal(未来) を実現している
これは、POD の管理と同様 の操作性ですよね?!
Machine Config Operator のちょっとイイかもしれない話
27. Machine のスケールアップ(例)
27
Machine
Deployment
Controller
MachineDeployment
Machine Set
Controller
MachineSet
Machine
Controller
Machine
Cloud
Instance
Future
NodeLink
Controller
Node
Bootstrap
Machine Config Operator のちょっとイイかもしれない話
[toaraki-redhat.com@clientvm 0 ~/cluster-c2ab]$ oc get machineset -n openshift-machine-api
NAME DESIRED CURRENT READY AVAILABLE AGE
cluster-c2ab-l5j4v-worker-ap-southeast-1a 1 1 1 1 45h
cluster-c2ab-l5j4v-worker-ap-southeast-1b 1 1 1 1 45h
cluster-c2ab-l5j4v-worker-ap-southeast-1c 0 0 45h
[toaraki-redhat.com@clientvm 0 ~/cluster-c2ab]$
[toaraki-redhat.com@clientvm 1 ~]$ oc scale --replicas=1 machineset cluster-c2ab-l5j4v-worker-ap-southeast-1c -n
openshift-machine-api
machineset.machine.openshift.io/cluster-c2ab-l5j4v-worker-ap-southeast-1c scaled
[toaraki-redhat.com@clientvm 0 ~]$ oc get machineset -n openshift-machine-api
NAME DESIRED CURRENT READY AVAILABLE AGE
cluster-c2ab-l5j4v-worker-ap-southeast-1a 1 1 1 1 45h
cluster-c2ab-l5j4v-worker-ap-southeast-1b 1 1 1 1 45h
cluster-c2ab-l5j4v-worker-ap-southeast-1c 1 1 45h
[toaraki-redhat.com@clientvm 0 ~]$
28. 28
Machine
Deployment
Controller
MachineDeployment
Machine Set
Controller
MachineSet
Machine
Controller
Machine
Cloud
Instance
Future
NodeLink
Controller
Node
Bootstrap
Machine Config Operator のちょっとイイかもしれない話
[toaraki-redhat.com@clientvm 0 ~]$ oc get machines -n openshift-machine-api
NAME STATE TYPE REGION ZONE AGE
cluster-c2ab-l5j4v-master-0 running m4.xlarge ap-southeast-1 ap-southeast-1a 45h
cluster-c2ab-l5j4v-master-1 running m4.xlarge ap-southeast-1 ap-southeast-1b 45h
cluster-c2ab-l5j4v-master-2 running m4.xlarge ap-southeast-1 ap-southeast-1c 45h
cluster-c2ab-l5j4v-worker-ap-southeast-1a-9gfz6 running m4.large ap-southeast-1 ap-southeast-1a 45h
cluster-c2ab-l5j4v-worker-ap-southeast-1b-lfsrp running m4.large ap-southeast-1 ap-southeast-1b 45h
cluster-c2ab-l5j4v-worker-ap-southeast-1c-ltv9p running m4.large ap-southeast-1 ap-southeast-1c 114s
[toaraki-redhat.com@clientvm 0 ~]$
Machine のスケールアップ(例)