工業製造
産業用モノのインターネット | 工業材料 | 機器のメンテナンスと修理 | 産業プログラミング |
home  MfgRobots >> 工業製造 >  >> Manufacturing Technology >> 産業技術

PLCnextでのクラスタ管理:産業オートメーションにおけるKubernetesの活用

ITでは何年も標準とされてきましたが、産業分野ではまだ大きな影響を与えていません。多くの場合、このようなテクノロジーは複雑すぎると、不要だと見なされます。問われるのは、これらが我々に利点をもたらすかどうかです。

Kubernetesを例にしたPLCnextのビジョン。

Kubernetes

Kubernetesは、コンテナなどを使用して、さまざまなデバイスを介してネットワークを形成するオーケストレーター(管理システム、マスター)です。このシステムは、アプリケーションを少し異なる方法で提供するために使用されます。

従来、アプリケーションはデバイスに分散して維持されていました。どのコンピューターでアプリケーションが実行されているかは既知です。アプリケーションを別のコンピューターで実行する必要がある場合、これは人間によって行われなければなりません。コンピューターのいずれかが故障すると、そのコンピューターのすべてのアプリケーションが利用できなくなります。

Kubernetesでは、マスターにアプリケーションの状態記述が与えられ、マスターが残りを処理します。要求された状態が常に維持されることを保証します。ただし、アプリケーションが現在どのノードで実行されているかは不明ですが、原則としてアクセス可能です。

質問と回答

状態記述とは何ですか?

クラスタをインストールするには?

アプリケーションのアップデートはどう行う?

ノードが故障したら?

マスターが故障したら?

特定のアプリケーションを特定のノードで実行する必要がある(ハードウェアアクセスが必要なため)

PLCnextでのクラスタ管理:産業オートメーションにおけるKubernetesの活用 PLCnextでのクラスタ管理:産業オートメーションにおけるKubernetesの活用

例

3つのコンテナ(フロントエンド、バックエンド、データベース)で構成されるアプリケーションの状態記述の例。

Deployment:

Service:

Ingress:

# Kind of the Deployment
kind: Deployment
apiVersion: apps/v1
metadata:
  name: MyApplicationName
  labels:
    app: MyApplication
    MyApplication: MyApplicationName
    namespace: default

## Container specs
  spec:
    containers:

## Container spec for Frontend
## Name for the Container
    - name: MyContainer-frontend

## Container Image to use
      image: MyApplicationImage_frontend

## Ports for the frontend, http
      ports:
      - containerPort: 80

## Container spec for Backend
    - name: MyContainerName-backend
      image: MyApplicationImage_backend
      ports:
      - containerPort: 3000

## Container spec for mongodb
    - name: MyContainerName-mongo
      image: mongo:3.4

## Startup commands for Mongo DB
      command:
      - "mongod"
      - "--bind_ip"
      - "0.0.0.0"
      ports:
      - containerPort: 27017
---
## Service declaration, expose Ports to the kubernetes api (only internal reachable)

apiVersion: v1
kind: Service
metadata:
  name: MyApplicationName
spec:
  ports:
  - name: frontend
    targetPort: 80
    port: 80
  - name: backend
    targetPort: 3000
    port: 3000
  selector:
    app: MyApplication
    task: MyApplicationName

--- 
## Ingress declaration, bind proxy to fronted and backend

apiVersion: networking.k8s.io/v1beta1
kind: Ingress

## Bind ingress to traefik service proxy

metadata:
  name: MyApplicationName
  annotations:
    kubernetes.io/ingress.class: traefik

## Ingress class for frontend, map dns ingress to service port 80
spec:
  rules:
  - host: MyApp.Mydomain.de
    http:
      paths:
      - path: /
        backend:
          serviceName: MyApplicationName
          servicePort: frontend

## Ingress class for backend, map dns ingress to service port 3000
  - host: MyApplicationName.MyDomain.de
    http:
      paths:
      - path: /api
        backend:
          serviceName: MyApplicationName
          servicePort: backend

参考資料

https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/
https://github.com/k3s-io/k3s
https://github.com/rancher/k3d
https://github.com/inercia/k3x


産業技術

  1. プレス加工(スタンピング)完全解説:種類、プロセス、用途
  2. 摩擦溶接とは?原理、プロセス、メリット、用途を徹底解説
  3. サーマルスプレー完全解説:種類、用途、メリット
  4. ケイ酸ナトリウム:鋳造生産における効率と品質の向上
  5. PLCnext ControlでLinuxターミナルコマンドを使いVLAN設定を効率化
  6. PLCnextデバイスでgrpcurlを用いた安全なリモートgRPCアクセス
  7. PLCnext CLIテンプレートでC++開発を効率化
  8. DHCPで割り当てられたIPを持つPLCnext Webサーバーに安全にアクセス
  9. C#でPLCnextコンソールアプリケーションを開発:初心者ガイド
  10. TableauダッシュボードでPLCnextをリアルタイム監視
  11. PLCnextクラウドデータからPower BIダッシュボードを作成