-->

Saturday, November 20, 2021

[Solved] Error from server (ServiceUnavailable): the server is currently unable to handle the request (get nodes.metrics.k8s.io)

 Issue:- 

The issue was occuring when i tried to run the metric server inside the kubernetes. And after deploying tried to list the cpu utilization based on the nodes

[centos@k8smaster volumes]$ kubectl top nodes


Error:- 

Error from server (ServiceUnavailable): the server is currently unable to handle the request (get nodes.metrics.k8s.io)


Resolution:-

This can easily be resolved by editing the deployment yaml files and adding the hostNetwork: true after the dnsPolicy: ClusterFirst

kubectl edit deployments.apps -n kube-system metrics-server
hostNetwork: ture



Sunday, November 14, 2021

[Solved] UI_set_result:result too small:ui_lib.c:869:Yo u must type in 4 to 1024 characters

 Issue:- 

The issue was occuring when i tried to generate the certificate using the following command.

sudo openssl genrsa -des3 -out server.key 1024

Error:- 

UI_set_result:result too small:ui_lib.c:869:You must type in 4 to 1024 characters

Cause:-

Leave off the -des3 flag, which is an instruction to the openssl to encrypt the server.keynew which is not a new key at all - its exactly the same key as server.key only with the passphrase changed or removed.

Resolution:-

so i updated the command as 

sudo openssl genrsa -out server.key 1024
which worked fine.

[Solved] ssl received a record that exceeded the maximum permissible length centos

 Issue:- 

Issue occured when i tried to create the reverse proxy in the nginx

upstream dashboard {
    server 172.31.4.205:30545;
}

server {
    listen 443;
    listen [::]:443;

    ssl_certificate /etc/nginx/ssl/server.crt;
    ssl_certificate_key /etc/nginx/ssl/server.key;

    location / {
        proxy_set_header X-Forwarded-Host $host:$server_port;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass https://dashboard;
    }
}
   

Error:- 

ssl received a record that exceeded the maximum permissible length centos

Friday, November 5, 2021

[Solved] nginx unknown directive "upstream"

Issue:- 

The issue occured when i was trying to use the upstream to proxypass i.e. use the nginx as reverse proxy for exposing the kubernetes application.


Error:- 

unknown directive "upstream" in /etc/nginx/nginx.conf:1 configuration file /etc/nginx/nginx.conf test failed


Cause:-

In Nginx upstream directive is only valid in the http contex.


Resolution:-

So instead of making the changes in the nginx.conf try to use this in the default.conf. Also I preferred to proxy the request directly in the default.conf which actually got the rid of the upstream although when i tested upstream also worked fine. So i made the change under /etc/nginx/sites-enabled/default.conf which is soft link to /etc/nginx/sites-available/default.conf

[Solved] ValidationError(Deployment.spec): missing required field "selector" in io.k8s.api.apps.v1.DeploymentSpec

 Issue:- 

Issue occured when i tried to deployed the deployment yaml file on the kubernetes.

kind: Deployment  
 metadata:  
  name: jenkins  
  namespace: jenkins  
  template:  
   metadata:  
    labels:  
     app: jenkins  
   spec:  
    volumes:  
    - name: jenkins-home  
     persistentVolumeClaim:  
      claimName: pvc-nfs-pv1  
    containers:  
     - name: jenkins  
      image: jenkins/jenkins:lts  
      lifecycle:  
       postStart:  
        exec:  
         command: ["/bin/sh", "-c", "/var/jenkins_home/ip-update.sh"]  
      env:  
       - name: JAVA_OPTS  
        value: -Djenkins.install.runSetupWizard=false  
      ports:  
       - name: http-port  
        containerPort: 8080  
       - name: jnlp-port  
        containerPort: 50000  
      volumeMounts:  
       - name: jenkins-home  
        mountPath: /var/jenkins_home  


Error:- 

ValidationError(Deployment.spec): missing required field "selector" in io.k8s.api.apps.v1.DeploymentSpec