Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to deploy the load-watcher as a service? #56

Open
colocasia98 opened this issue Feb 2, 2023 · 3 comments
Open

how to deploy the load-watcher as a service? #56

colocasia98 opened this issue Feb 2, 2023 · 3 comments

Comments

@colocasia98
Copy link

Hi all,
I found this line in README:
kubectl create -f manifests/load-watcher-deployment.yaml
but I did not find the manifests/load-watcher-deployment.yaml in repo.
Maybe a sample deployment file is needed?
thanks.

@lenhattan86
Copy link
Collaborator

load-watcher-deployment.yaml can be something like:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: load-watcher-deployment
  labels:
    app: load-watcher
spec:
  replicas: 1
  selector:
    matchLabels:
      app: load-watcher
  template:
    metadata:
      labels:
        app: load-watcher
    spec:
      containers:
      - name: load-watcher
        image: [load-watcher image]
        env:
        - name: METRICS_PROVIDER_NAME
          value: [eg. SignaFx]
        - name: METRICS_PROVIDER_ADDRESS
          value: [metrics_provider_endpoint]
        - name: METRICS_PROVIDER_TOKEN
          value: [token]
        - name: SIGNALFX_CLUSTER_NAME
          value: [cluster_name]
        ports:
        - containerPort: 2020

@colocasia98
Copy link
Author

Thanks a lot for your reply. Hope to add this file to the repo soon.

wangchen615 pushed a commit that referenced this issue Apr 27, 2023
lenhattan86 pushed a commit that referenced this issue May 16, 2023
* resolve issue #56

* quick fix of CA x509 issue

* fix the error loading CA file

---------

Co-authored-by: root <[email protected]>
@xiaooloong
Copy link

xiaooloong commented Dec 8, 2023

you may need rbac if you are using metrics server

apiVersion: v1
kind: ServiceAccount
metadata:
  name: load-watcher
  namespace: loadwatcher
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: load-watcher-role
rules:
  - apiGroups: [""]
    resources: ["nodes"]
    verbs: ["get", "list", "watch"]
  - apiGroups: ["metrics.k8s.io"]
    resources: ["nodes"]
    verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: load-watcher-binding
subjects:
  - kind: ServiceAccount
    name: load-watcher
    namespace: loadwatcher
roleRef:
  kind: ClusterRole
  name: load-watcher-role
  apiGroup: rbac.authorization.k8s.io
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: load-watcher-deployment
  namespace: loadwatcher
  labels:
    app: load-watcher
spec:
  replicas: 1
  selector:
    matchLabels:
      app: load-watcher
  template:
    metadata:
      labels:
        app: load-watcher
    spec:
      serviceAccountName: load-watcher
      containers:
      - name: load-watcher
        image: load-watcher:1
        ports:
        - containerPort: 2020
---
apiVersion: v1
kind: Service
metadata:
  namespace: loadwatcher
  name: load-watcher
  labels:
    app: load-watcher
spec:
  type: ClusterIP
  ports:
  - name: http
    port: 2020
    targetPort: 2020
    protocol: TCP
  selector:
    app: load-watcher

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants