开源it-tools工具箱部署文档on k8s

it-tools简介

IT-Tools是一个开源项目,旨在为IT从业者提供一个集成的在线工具。此项目具有功能全面、部署方便等特点,目前在github上4.7K的star。

https://github.com/CorentinTh/it-tools

https://tools.gaojinbo.com/

部署it-tools

vi tools.yaml 
apiVersion: v1
kind: Service
metadata:
  name: tools
  labels:
    app: tools
spec:
  ports:
    - port: 80
  selector:
    app: tools
    tier: frontend
  type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: tools
  labels:
    app: tools
spec:
  replicas: 2
  minReadySeconds: 5
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
  selector:
    matchLabels:
      app: tools
      tier: frontend
  template:
    metadata:
      labels:
        app: tools
        tier: frontend
    spec:
      containers:
      - image: corentinth/it-tools:2023.11.2-7d94e11
        name: tools
        resources:
          limits:
            memory: 2000Mi
            cpu: 500m
          requests:
            memory: 1000Mi
            cpu: 100m
        livenessProbe:
          tcpSocket:
            port: 80
          initialDelaySeconds: 1
          periodSeconds: 3
          timeoutSeconds: 10
        readinessProbe:
          httpGet:
            port: 80
            path: /index.html
          initialDelaySeconds: 1
          periodSeconds: 5
        lifecycle:
          preStop:
            exec:
              command: ["sh", "-c", "sleep 10"]
        ports:
        - containerPort: 80
          name: tools
kubectl -n web apply -f tools.yaml

istio网关配置

vi istio-tools.yaml 
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: tools-gateway
spec:
  # The selector matches the ingress gateway pod labels.
  # If you installed Istio using Helm following the standard documentation, this would be "istio=ingress"
  selector:
    istio: ingressgateway # use istio default controller
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "tools.gaojinbo.com"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: tools-vs
spec:
  hosts:
  - "tools.gaojinbo.com"
  gateways:
  - tools-gateway
  http:
  - route:
    - destination:
        host: tools 
        port:
          number: 80
kubectl -n web apply -f istio-tools.yaml