diff --git a/Dockerfile.client b/Dockerfile.client index bbf1bd1..9a00125 100644 --- a/Dockerfile.client +++ b/Dockerfile.client @@ -9,8 +9,10 @@ RUN go mod download COPY . . COPY pb ../pb +ENV GOOS=linux +ENV GOARCH=arm64 RUN go install -v ./... EXPOSE 3000 -CMD [ "client" ] +CMD [ "/go/bin/linux_arm64/client" ] diff --git a/Dockerfile.server b/Dockerfile.server index 6d2487e..7f5a685 100644 --- a/Dockerfile.server +++ b/Dockerfile.server @@ -9,8 +9,10 @@ RUN go mod download COPY . . COPY pb ../pb +ENV GOOS=linux +ENV GOARCH=arm64 RUN go install -v ./... EXPOSE 3000 -CMD [ "server" ] +CMD [ "/go/bin/linux_arm64/server" ] diff --git a/k8s/client.yaml b/k8s/client.yaml new file mode 100644 index 0000000..0ebe5ca --- /dev/null +++ b/k8s/client.yaml @@ -0,0 +1,36 @@ +apiVersion: apps/v1beta1 +kind: Deployment +metadata: + name: client-deployment + namespace: grpc-mocker + labels: + app: client +spec: + selector: + matchLabels: + app: client + replicas: 1 + template: + metadata: + labels: + app: client + spec: + containers: + - name: client + image: harbor.strikerlulu.me/works/grpc-mocker/client + imagePullPolicy: Never + ports: + - name: client-service + containerPort: 3000 +--- +apiVersion: v1 +kind: Service +metadata: + name: client-service +spec: + type: NodePort + selector: + app: client + ports: + - port: 3000 + targetPort: client-service diff --git a/k8s/server.yaml b/k8s/server.yaml new file mode 100644 index 0000000..acaae6a --- /dev/null +++ b/k8s/server.yaml @@ -0,0 +1,35 @@ +apiVersion: apps/v1beta1 +kind: Deployment +metadata: + name: server-deployment + namespace: grpc-mocker + labels: + app: server +spec: + selector: + matchLabels: + app: gcd + replicas: 3 + template: + metadata: + labels: + app: server + spec: + containers: + - name: server + image: harbor.strikerlulu.me/works/grpc-mocker/server + imagePullPolicy: Never + ports: + - name: grpc-server + containerPort: 3000 +--- +apiVersion: v1 +kind: Service +metadata: + name: grpc-server +spec: + selector: + app: grpc-srever + ports: + - port: 3000 + targetPort: grpc-server