From f2d06c7161a02b12c8338f043b2d1e3faf7b30c2 Mon Sep 17 00:00:00 2001 From: Smart-SangGe <2251250136@qq.com> Date: Thu, 4 Aug 2022 15:16:24 +0800 Subject: [PATCH] test --- .gitlab-ci.yml | 1 + deploy.yaml | 64 +++++++++++++++++++++++++++++++++++++++------ dockerfile | 1 + traefik-config.yaml | 21 +++++++++++++++ 4 files changed, 79 insertions(+), 8 deletions(-) create mode 100644 traefik-config.yaml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7ca1e38..0079347 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -50,6 +50,7 @@ docker_deploy: entrypoint: [""] script: # - kubectl run console-${POD_VERSION} --image=reg.sre.victor-core.top/cobalt-strike/console:${PACKAGE_VERSION} --kubeconfig=.kube/config --certificate-authority=.kube/ca.pem + - kubectl apply -f traefik-config.yaml - kubectl apply -f deploy.yaml tags: - cluster \ No newline at end of file diff --git a/deploy.yaml b/deploy.yaml index 891ae89..e9ad635 100644 --- a/deploy.yaml +++ b/deploy.yaml @@ -1,12 +1,60 @@ -apiVersion: apps/v1 -kind: Deployment +kind: Pod +apiVersion: v1 metadata: name: console - labels: + namespace: sangge + labels: app: console -sepc: +spec: + volumes: + - name: kube-api-access-zj4cn + projected: + sources: + - serviceAccountToken: + expirationSeconds: 3607 + path: token + - configMap: + name: kube-root-ca.crt + items: + - key: ca.crt + path: ca.crt + - downwardAPI: + items: + - path: namespace + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + defaultMode: 420 containers: - - name: console - image: reg.sre.victor-core.top/cobalt-strike/console:1.3.0 - ports: - - containerPort: 4444 + - name: container-ezl95t + image: 'reg.sre.victor-core.top/cobalt-strike/console:1.3.0' + resources: + requests: + cpu: 10m + volumeMounts: + - name: kube-api-access-zj4cn + readOnly: true + mountPath: /var/run/secrets/kubernetes.io/serviceaccount + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + imagePullPolicy: IfNotPresent + restartPolicy: Always + terminationGracePeriodSeconds: 30 + dnsPolicy: ClusterFirst + serviceAccountName: default + serviceAccount: default + nodeName: 172.22.161.246 + securityContext: {} + schedulerName: default-scheduler + tolerations: + - key: node.kubernetes.io/not-ready + operator: Exists + effect: NoExecute + tolerationSeconds: 300 + - key: node.kubernetes.io/unreachable + operator: Exists + effect: NoExecute + tolerationSeconds: 300 + priority: 0 + enableServiceLinks: true + preemptionPolicy: PreemptLowerPriority diff --git a/dockerfile b/dockerfile index 0ebb617..4dce89d 100644 --- a/dockerfile +++ b/dockerfile @@ -1,4 +1,5 @@ from golang:latest copy . /go run go build -o console console.go +expose 4444 entrypoint ./console \ No newline at end of file diff --git a/traefik-config.yaml b/traefik-config.yaml new file mode 100644 index 0000000..8d4761d --- /dev/null +++ b/traefik-config.yaml @@ -0,0 +1,21 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: console + namespace: sangge + labels: + app: console + annotations: + kubenetes.io/ingress.class: traefik +spec: + rules: + - host: sangge.sre.victor-core.top + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: console + port: + number: 4444