From ab30afbce0d295a09cb8077fcdcb659a238d20a2 Mon Sep 17 00:00:00 2001 From: w-mj Date: Wed, 15 Feb 2023 09:56:03 +0800 Subject: [PATCH] basic go-client pass --- Makefile | 11 ++++++++++- install.yaml | 15 ++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 43c6a5c..4475113 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,16 @@ IMAGE_TAG ?= docker.educg.net/k8s/manager:dev +build: export CGO_ENABLED=0 +build: export GOOS=linux +build: export GOARCH=amd64 build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o out/manager + go build -o out/manager main.go docker: build docker build --rm -t $(IMAGE_TAG) . + +install: docker + kubectl apply -f install.yaml + +uninstall: + kubectl delete -f install.yaml \ No newline at end of file diff --git a/install.yaml b/install.yaml index 81382db..02d28b6 100644 --- a/install.yaml +++ b/install.yaml @@ -22,4 +22,17 @@ spec: - containerPort: 8080 --- apiVersion: v1 -kind: Service \ No newline at end of file +kind: Service +metadata: + name: k8s-manager-service + labels: + name: k8s-manager-service +spec: + type: NodePort + ports: + - port: 80 + targetPort: 8080 + protocol: TCP + nodePort: 30001 + selector: + app: k8s-manager-deployment \ No newline at end of file