add skywalking dockerfile and prod redis

main
ycz008 2024-03-25 17:58:41 +08:00
parent 00be9c6daa
commit 6e998c5eef
3 changed files with 56 additions and 35 deletions

View File

@ -0,0 +1,15 @@
FROM alpine:3.19 as builder
ARG SKYWALKING_AGENT="apache-skywalking-java-agent-9.1.0.tgz"
RUN wget https://dlcdn.apache.org/skywalking/java-agent/9.1.0/$SKYWALKING_AGENT && \
tar xf $SKYWALKING_AGENT
FROM openjdk:11-jre-slim
LABEL MAINTRAINER="beaconfire"
ENV SW_AGENT_COLLECTOR_BACKEND_SERVICES="" \
SW_AGENT_NAME=""
COPY --from=builder /skywalking-agent /agent

View File

@ -0,0 +1,15 @@
FROM alpine:3.19 as builder
ARG SKYWALKING_AGENT="apache-skywalking-java-agent-9.1.0.tgz"
RUN wget https://dlcdn.apache.org/skywalking/java-agent/9.1.0/$SKYWALKING_AGENT && \
tar xf $SKYWALKING_AGENT
FROM openjdk:8-jre-slim
LABEL MAINTRAINER="beaconfire"
ENV SW_AGENT_COLLECTOR_BACKEND_SERVICES="" \
SW_AGENT_NAME=""
COPY --from=builder /skywalking-agent /agent

View File

@ -1,20 +1,3 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: redis-config
labels:
app: redis
data:
redis.conf: |-
dir /srv
port 6379
bind 0.0.0.0
appendonly yes
daemonize no
requirepass beaconfire@123
pidfile /srv/redis-6379.pid
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
@ -41,20 +24,23 @@ spec:
privileged: true privileged: true
containers: containers:
- name: redis - name: redis
image: redis:6.2.12 image: redis/redis-stack-server:7.2.0-v0
command:
- "sh"
- "-c"
- "redis-server /usr/local/redis/redis.conf"
ports: ports:
- containerPort: 6379 - protocol: TCP
containerPort: 6379
env:
- name: "REDIS_ARGS"
value: "--requirepass beaconfire@123"
volumeMounts:
- name: redis
mountPath: /data
resources: resources:
limits: limits:
cpu: 1 cpu: 1
memory: 1Gi memory: 2Gi
requests: requests:
cpu: 50m cpu: 100m
memory: 128Mi memory: 256Mi
livenessProbe: livenessProbe:
tcpSocket: tcpSocket:
port: 6379 port: 6379
@ -71,14 +57,19 @@ spec:
periodSeconds: 10 periodSeconds: 10
successThreshold: 1 successThreshold: 1
failureThreshold: 3 failureThreshold: 3
volumeMounts:
- name: config
mountPath: /usr/local/redis/redis.conf
subPath: redis.conf
volumes: volumes:
- name: config - name: redis
configMap: hostPath:
name: redis-config path: /data/prod/redis
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "kubernetes.io/hostname"
operator: In
values:
- bfs-k8snode-10-2-2-8.hetzner.base.beaconfireinc.com
--- ---
apiVersion: v1 apiVersion: v1
@ -90,7 +81,7 @@ spec:
- port: 6379 - port: 6379
protocol: TCP protocol: TCP
targetPort: 6379 targetPort: 6379
nodePort: 30011 nodePort: 30006
selector: selector:
app: redis app: redis
type: NodePort type: ClusterIP