使用 cat 方式修改文件内容

命令: cat << EOF > 文件名称

  1. root@noway-587f65cd54-767sk:~/noway# cat << EOF > ingress.yaml
  2. > apiVersion: extensions/v1beta1
  3. kind: Ingress
  4. metadata:
  5. name: nginx-service-ingress
  6. annotations:
  7. kubernetes.io/ingress.class: "nginx"
  8. spec:
  9. rules:
  10. - host: {company}.test4u.cn
  11. http:
  12. paths:
  13. - path:
  14. backend:
  15. serviceName: {company}-system-edge-ui-app
  16. servicePort: 80
  17. >
  18. > EOF
  19. root@noway-587f65cd54-767sk:~/noway#