Giter VIP home page Giter VIP logo

cfdsa's Introduction

CFDSA - Container for Deployment and Scaling Apps

Installing Metrics Server

Copy the metrics-server deployment

Go to [https://github.com/kubernetes-sigs/metrics-server/releases] (https://github.com/kubernetes-sigs/metrics-server/releases) and download the latest release. The file should be components.yaml.

Update metrics-server pod

Edit components.yaml. Look for the following line:

image: k8s.gcr.io/metrics-server-amd64:v0.3.1

and perform the following edits

containers:
 name: metrics-server
  image: k8s.gcr.io/metrics-server-amd64:vx.x.x
  imagePullPolicy: IfNotPresent
  args:
  - --cert-dir=/tmp
  - --secure-port=4443
 # add the lines below
  - --kubelet-insecure-tls
  - --kubelet-preferred-address-types=InternalIP

Ref SO: Unable to get pod metrics to use in horizontal pod autoscaling -Kubernetes

Install metrics-server

Install the metrics server in the usual manner

kubectl apply -f components.yaml

Verify that metrics-server is deploy with the following

kubectl get svc/metrics-server -n kube-system

NAME             TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                  AGE
kube-dns         ClusterIP   10.245.0.10      <none>        53/UDP,53/TCP,9153/TCP   25h
metrics-server   ClusterIP   10.245.165.141   <none>        443/TCP                  24h

Verify that the metrics server is indeed collecting metrics by executing a top.

kubectl top nodes

NAME                   CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%   
pool-95hh57dhz-389l6   129m         6%     1857Mi          59%       
pool-95hh57dhz-389lt   136m         6%     1778Mi          57%      

Note you may have to wait a minute or two before the stats appear.

Installing WebUI

WebUI in not installed by default. To install Kubernetes' WebUI, go to the release page and find the latest (or desired version). Install with kubectl apply

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.x.x/aio/deploy/recommended.yaml

On a terminal, start a proxy server

kubectl proxy

The WebUI can now be accessed with the following URL

http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/

WebUI login

Login to WebUI

Create a service account and give it the cluster-admin role (or you can create a role with limited privileges).

---
apiVersion: v1
kind: ServiceAccount

metadata:
   name: webui-user
   namespace: kube-system

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding

metadata:
   name: webui-user
   namespace: kube-system

roleRef:
   apiGroup: rbac.authorization.k8s.io
   kind: ClusterRole
   name: cluster-admin

subjects:
- kind: ServiceAccount
  name: webui-user
  namespace: kube-system

Create the service account kubectl apply -f sa.yaml assuming the file is called sa.yaml.

Get the secret for the service account

kubectl describe sa/webui-user -n kube-system

Look for Mountable secrets. Copy the secret's name.

kubectl describe secret/secret_name_here -n kube-system

Copy the token value and paste it into the 'Enter token' field.

Alternative to Web UI

If you are concern about the load WebUI place on your cluster, you can try out-of-cluster tool like Octant

Installing Nginx Ingress Controller

Nginx Ingress controller is deployed using helm. Create a namespace called nginx-ingress and deploy the helm chart into the namespace.

helm install <release name> stable/nginx-ingress --version <version number> -n nginx-ingress

Verify that a load balancer is provisioned by running the following command

kubectl get svc -n nginx-ingress

NAME            TYPE           CLUSTER-IP     EXTERNAL-IP      PORT(S)                      AGE
ingress-nginx   LoadBalancer   10.245.17.17   157.230.196.98   80:30077/TCP,443:31512/TCP   21m

Note: EXTERNAL-IP will show an external IP address once the load balancer has been deployed. A <pending> indicates that the cloud provider is still provisioning the load balancer. You can verify the that the load balancer has indeed been provisioned by checking it in your cloud console.

cfdsa's People

Contributors

chukmunnlee avatar stackupiss avatar

Watchers

Zeming lim avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.