Showing posts with label kubernetes. Show all posts
Showing posts with label kubernetes. Show all posts

Wednesday, June 14, 2023

Error creating: admission webhook "namespace.sidecar-injector.istio.io" denied the request: failed to run injection template: template: inject:212:12: executing "inject" at <.EstimatedConcurrency>: can't evaluate field EstimatedConcurrency in type *inject.SidecarTemplateData

 Problem:

Error creating: admission webhook "namespace.sidecar-injector.istio.io" denied the request: failed to run injection template: template: inject:212:12: executing "inject" at <.EstimatedConcurrency>: can't evaluate field EstimatedConcurrency in type *inject.SidecarTemplateData

Solution:

In vaulues.yaml, make below change:

pilot:

  # Can be a full hub/image:taggcr.io/istio-release
  image: gcr.io/istio-release/pilot:1.16.5

Sunday, March 14, 2021

Kubernetes: kubectl config management.

 Config kubectl

Script to set current contexts:

clear


production="true"


[[ $0 != $BASH_SOURCE ]] && contextName=$BASH_SOURCE || contextName=$0


contextName=${contextName##*/}


export KUBECONFIG=~/.kube/config.${contextName}


kubectl config use-context ${contextName}


#starts 38;5; for the foreground and 48;5; for the background, then the color number


if [ $production == "true" ]; then

  export PS1="\e[38;5;016;0;48;5;166m\u@\H:\w - \e[5m$contextName\e[25m $ "

else

  export PS1="\e[38;5;012;48;5;015m\u@\H:\w - $contextName $ "

fi

  

kubectl config get-contexts

Sunday, October 4, 2020

Kubernetes Pod Readiness Probe

Readiness Probe: 

1. httpGet 

readinessProbe:
  httpGet:
    path: /api/ready
    port: 8080

2. tcpSocket:

readinessProbe:
  topSocket:
    port:3306

3. command

readinessProbe:
  exec:
    command:
       - cat
      -/app/is_ready


Liveness Probe:

 1. httpGet 

livenessProbe:
  httpGet:
    path: /api/ready
    port: 8080 
  initialDelaySeconds: 10 
  periodSeconds: 5 
  failureThreshold: 8 

 
 

2. tcpSocket:

livenessProbe:
  topSocket:
    port:3306


3. command

livenessProbe:
  exec:
    command:
       - cat
      -/app/is_ready


 

Monday, September 28, 2020

Kubectl Cheatsheet

$ kubectl get svc --all-namespaces  | awk '{{gsub(/,/, ";", $6)}; a = ""; for (i = 1 ; i <= NF -1 ; i++) a = a $i "," ; print substr(a, 1, length(a)-1)}'