From 6e998c5eef44c5eb6676975a05ffdf05b0560da7 Mon Sep 17 00:00:00 2001 From: ycz008 Date: Mon, 25 Mar 2024 17:58:41 +0800 Subject: [PATCH] add skywalking dockerfile and prod redis --- build-image/skywalking/Dockerfile | 15 +++++++ build-image/skywalking/Dockerfile_8 | 15 +++++++ prod-upgrade/redis/redis.yaml | 61 ++++++++++++----------------- 3 files changed, 56 insertions(+), 35 deletions(-) create mode 100644 build-image/skywalking/Dockerfile create mode 100644 build-image/skywalking/Dockerfile_8 diff --git a/build-image/skywalking/Dockerfile b/build-image/skywalking/Dockerfile new file mode 100644 index 0000000..e62879d --- /dev/null +++ b/build-image/skywalking/Dockerfile @@ -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 \ No newline at end of file diff --git a/build-image/skywalking/Dockerfile_8 b/build-image/skywalking/Dockerfile_8 new file mode 100644 index 0000000..1c87895 --- /dev/null +++ b/build-image/skywalking/Dockerfile_8 @@ -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 \ No newline at end of file diff --git a/prod-upgrade/redis/redis.yaml b/prod-upgrade/redis/redis.yaml index 7e32931..e364681 100644 --- a/prod-upgrade/redis/redis.yaml +++ b/prod-upgrade/redis/redis.yaml @@ -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 kind: Deployment @@ -41,20 +24,23 @@ spec: privileged: true containers: - name: redis - image: redis:6.2.12 - command: - - "sh" - - "-c" - - "redis-server /usr/local/redis/redis.conf" + image: redis/redis-stack-server:7.2.0-v0 ports: - - containerPort: 6379 + - protocol: TCP + containerPort: 6379 + env: + - name: "REDIS_ARGS" + value: "--requirepass beaconfire@123" + volumeMounts: + - name: redis + mountPath: /data resources: limits: cpu: 1 - memory: 1Gi + memory: 2Gi requests: - cpu: 50m - memory: 128Mi + cpu: 100m + memory: 256Mi livenessProbe: tcpSocket: port: 6379 @@ -71,14 +57,19 @@ spec: periodSeconds: 10 successThreshold: 1 failureThreshold: 3 - volumeMounts: - - name: config - mountPath: /usr/local/redis/redis.conf - subPath: redis.conf volumes: - - name: config - configMap: - name: redis-config + - name: redis + hostPath: + 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 @@ -90,7 +81,7 @@ spec: - port: 6379 protocol: TCP targetPort: 6379 - nodePort: 30011 + nodePort: 30006 selector: app: redis - type: NodePort + type: ClusterIP