apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: default
  name: community-ip2location
spec:
  replicas: 2
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
  selector:
    matchLabels:
      app: community-ip2location
  template:
    metadata:
      labels:
        app: community-ip2location
    spec:
      containers:
      - name: server
        image: registry.cn-hangzhou.aliyuncs.com/pingcap-ee/community-ip2location:v2022-08-22-16-52-15
        livenessProbe:
          httpGet:
            path: /1.1.1.1
            port: 8080
          periodSeconds: 10
          initialDelaySeconds: 3
          successThreshold: 1
          timeoutSeconds: 4
        ports:
        - containerPort: 8080
        resources:
          limits:
            cpu: "2"
            memory: 4Gi
          requests:
            cpu: "0.25"
            memory: 256Mi
      imagePullSecrets:
      - name: aliyun-hangzhou-registry

---

apiVersion: v1
kind: Service
metadata:
  namespace: default
  name: community-ip2location
  labels:
    app: community-ip2location
spec:
  ports:
    - port: 80
      targetPort: 8080
      protocol: TCP
      name: http
  selector:
    app: community-ip2location

---

apiVersion: v1
kind: Service
metadata:
  namespace: default
  name: community-ip2location-inner-ulb
  labels:
    app: community-ip2location
  annotations:
    service.beta.kubernetes.io/ucloud-load-balancer-id: "ulb-hl1wxodp"
    service.beta.kubernetes.io/ucloud-load-balancer-type: "inner"
    service.beta.kubernetes.io/ucloud-load-balancer-vserver-client-timeout: "60"
spec:
  type: LoadBalancer
  externalTrafficPolicy: Local
  ports:
    - protocol: TCP 
      port: 80
      targetPort: 8080
  selector:
    app: community-ip2location
