diff --git a/helm-charts/proxy-kubernetes-cloudflared-redis/Chart.yaml b/helm-charts/proxy-kubernetes-cloudflared-redis/Chart.yaml new file mode 100644 index 000000000..1ef0cf0b5 --- /dev/null +++ b/helm-charts/proxy-kubernetes-cloudflared-redis/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: proxy-kubernetes-cloudflared-redis +version: "1.0.0" +maintainers: + - name: GiganticMinecraft diff --git a/helm-charts/proxy-kubernetes-cloudflared-redis/templates/deployment.yaml b/helm-charts/proxy-kubernetes-cloudflared-redis/templates/deployment.yaml new file mode 100644 index 000000000..489437af0 --- /dev/null +++ b/helm-charts/proxy-kubernetes-cloudflared-redis/templates/deployment.yaml @@ -0,0 +1,59 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: cloudflared-redis--{{ .Values.RedisServerName }} + labels: + app: cloudflared-redis--{{ .Values.RedisServerName }} + appgroup: cloudflared + release-namespace: {{ .Release.Namespace }} +spec: + replicas: 1 + selector: + matchLabels: + app: cloudflared-redis--{{ .Values.RedisServerName }} + appgroup: cloudflared + release-namespace: {{ .Release.Namespace }} + template: + metadata: + labels: + app: cloudflared-redis--{{ .Values.RedisServerName }} + appgroup: cloudflared + release-namespace: {{ .Release.Namespace }} + spec: + containers: + - name: cloudflared-redis--{{ .Values.RedisServerName }} + image: cloudflare/cloudflared:2021.12.1 + args: + - access + - tcp + - --loglevel + - debug + - --hostname + - redis--{{ .Values.RedisServerName }}.{{ .Values.subdomain }}.seichi.click + - --url + - 0.0.0.0:6379 + env: + - name: TUNNEL_SERVICE_TOKEN_ID + valueFrom: + secretKeyRef: + name: cloudflared-access-token + key: TUNNEL_SERVICE_TOKEN_ID + - name: TUNNEL_SERVICE_TOKEN_SECRET + valueFrom: + secretKeyRef: + name: cloudflared-access-token + key: TUNNEL_SERVICE_TOKEN_SECRET + ports: + - containerPort: 6379 + name: redis + readinessProbe: + initialDelaySeconds: 15 + periodSeconds: 5 + timeoutSeconds: 1 + successThreshold: 2 + failureThreshold: 2 + tcpSocket: + port: 6379 + resources: + requests: + memory: 64Mi diff --git a/helm-charts/proxy-kubernetes-cloudflared-redis/templates/service.yaml b/helm-charts/proxy-kubernetes-cloudflared-redis/templates/service.yaml new file mode 100644 index 000000000..0e6abe6e4 --- /dev/null +++ b/helm-charts/proxy-kubernetes-cloudflared-redis/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: cloudflared-redis--{{ .Values.RedisServerName }} +spec: + type: ClusterIP + ports: + - name: redis + port: 6379 + protocol: TCP + targetPort: 6379 + selector: + app: cloudflared-redis--{{ .Values.RedisServerName }} + appgroup: cloudflared + release-namespace: {{ .Release.Namespace }} diff --git a/helm-charts/proxy-kubernetes-cloudflared-redis/values.yaml b/helm-charts/proxy-kubernetes-cloudflared-redis/values.yaml new file mode 100644 index 000000000..8a7ae3b65 --- /dev/null +++ b/helm-charts/proxy-kubernetes-cloudflared-redis/values.yaml @@ -0,0 +1,7 @@ +# プロキシされる先のRedisサーバーの識別子。 +RedisServerName: "redisbungee" +# ホスト名の seichi.click 以下のサブドメイン名。 +subdomain: "tcp-network" +# この二つの設定で、プロキシ先の hostname が +# redis--{{ .Values.RedisServerName }}.{{ .Values.subdomain }}.seichi.click +# のように設定される。