apiVersion: v1
kind: ConfigMap
metadata:
  name: keycloak-frpc-config
  namespace: keycloak
  labels:
    app.kubernetes.io/name: keycloak-frpc
    hwlab.pikastech.local/component: identity
data:
  frpc.toml: |
    serverAddr = "74.48.78.17"
    serverPort = 7000
    loginFailExit = true

    [[proxies]]
    name = "keycloak-public-https"
    type = "tcp"
    localIP = "keycloak.keycloak.svc.cluster.local"
    localPort = 8080
    remotePort = 28443
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: keycloak-frpc
  namespace: keycloak
  labels:
    app.kubernetes.io/name: keycloak-frpc
    hwlab.pikastech.local/component: identity
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app.kubernetes.io/name: keycloak-frpc
  template:
    metadata:
      labels:
        app.kubernetes.io/name: keycloak-frpc
        hwlab.pikastech.local/component: identity
    spec:
      containers:
        - name: frpc
          image: fatedier/frpc:v0.68.1
          args:
            - -c
            - /etc/frp/frpc.toml
          volumeMounts:
            - name: config
              mountPath: /etc/frp
              readOnly: true
      volumes:
        - name: config
          configMap:
            name: keycloak-frpc-config
