• YAML DEMO


    有时候会用到避免重写,重找麻烦

    1.busybox

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: client
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: client
      template:
        metadata:
          labels:
            app: client
        spec:
          containers:
          - name: busybox
            image: busybox:1.28.4
            imagePullPolicy: IfNotPresent
            command: ["/bin/sh","-c","sleep 3600"]

     command: ["/bin/sh","-c","echo 'hello httpd' > /var/www/index/html;httpd -f -p 8080 -h /var/www"] #开启httpd

    2. nginx

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: nginx-test
      labels:
        app: nginx-test
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: nginx-test
      template:
        metadata:
          labels:
            app: nginx-test
        spec:
          containers:
          - name: nginx
            image: nginx
            imagePullPolicy: IfNotPresent
            ports:
            - containerPort: 80
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: nginx-test
      labels:
        app: nginx-test
    spec:
      ports:
      - name: nginx-test
        port: 80
        targetPort: 80
      selector:
        app: nginx-test
  • 相关阅读:
    实验17:NAT
    实验16:ACL
    实验15: STP
    实验14:VLAN间的路由
    实验13:VLAN/TRUNK/VTP/
    Linux软件管理--RPM工具
    Linux拓展练习部分--输入输出 / find部分 /基础拓展2
    linux文件管理--压缩打包
    find 文件查找
    防火墙知识点
  • 原文地址:https://www.cnblogs.com/Tempted/p/14107702.html
Copyright © 2020-2023  润新知