You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
| [Cluster Autoscaler](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler)| Nodes | **Up:** Pending pod <br/> **Down:** Node resource allocations is low | On GKE we can turn on/off autoscaler and configure min/max per node group can be also installed separately | Listens on pending pods for scale up and node allocations for scaledown. Should have permissions to call cloud api. Considers pod affinity, pdb, storage, special annotations |
733
+
| [Horizontal Pod Autoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) | replicas on deployments or StatefulSets | metrics value thresholds defined in HPA object | part of Kubernetes controller | Controller gets metrics from "metrics.k8s.io/v1beta1" , "custom.metrics.k8s.io/v1beta1", "external.metrics.k8s.io/v1beta1" requires [metrics-server](https://github.com/kubernetes-sigs/metrics-server) and custom metrics adapters ([prometheus-adapter](https://github.com/kubernetes-sigs/prometheus-adapter), [stackdriver-adapter](https://github.com/GoogleCloudPlatform/k8s-stackdriver/tree/master/custom-metrics-stackdriver-adapter)) to listen on this API (see note (1) below) and adjusts deployment or sts replicas according to definitions in HorizontalPodAutocaler <br/> There are v1 and beta api versions for HorizontalPodAutocaler: <br/> [v1](https://github.com/kubernetes/api/blob/master/autoscaling/v1/types.go) - supports for resource metrics (cpu, memory) - `kubect get hpa` <br/> [v2beta2](https://github.com/kubernetes/api/blob/master/autoscaling/v2beta2/types.go) and [v2beta1](https://github.com/kubernetes/api/blob/master/autoscaling/v2beta1/types.go) - supports for both resource and custom metrics - `kubectl get hpa.v2beta2.autoscaling` **The metric value should decrease on adding new pods.** <br/> *Wrong metrics Example:* request rate <br/> *Right metrics Example:* average request rate per pod |
734
+
735
+
Note (1)
736
+
```
737
+
kubectl get apiservices | awk 'NR==1 || $1 ~ "metrics"'
To configure HPA for CFapi add `HorizontalPodAutoscaler` values to config.yaml, for example:
946
+
947
+
(assuming that we already have prometheus adapter configured for metrics `requests_per_pod`, `cpu_usage_avg`, `memory_working_set_bytes_avg`)
948
+
949
+
{% highlight yaml %}
950
+
{% raw %}
951
+
cfapi:
952
+
replicaCount: 4
953
+
resources:
954
+
requests:
955
+
memory: "4096Mi"
956
+
cpu: "1100m"
957
+
limits:
958
+
memory: "4096Mi"
959
+
cpu: "2200m"
960
+
HorizontalPodAutoscaler:
961
+
minReplicas: 2
962
+
maxReplicas: 16
963
+
metrics:
964
+
- type: Object
965
+
object:
966
+
metricName: requests_per_pod
967
+
target:
968
+
apiVersion: "v1"
969
+
kind: Service
970
+
name: cf-cfapi
971
+
targetValue: 10
972
+
- type: Object
973
+
object:
974
+
metricName: cpu_usage_avg
975
+
target:
976
+
apiVersion: "apps/v1"
977
+
kind: Deployment
978
+
name: cf-cfapi-base
979
+
targetValue: 1
980
+
- type: Object
981
+
object:
982
+
metricName: memory_working_set_bytes_avg
983
+
target:
984
+
apiVersion: "apps/v1"
985
+
kind: Deployment
986
+
name: cf-cfapi-base
987
+
targetValue: 3G
988
+
{% endraw%}
989
+
{% endhighlight %}
990
+
991
+
**Querying metrics (for debugging)**
992
+
993
+
CPU Metric API Call
994
+
995
+
```
996
+
kubectl get --raw /apis/metrics.k8s.io/v1beta1/namespaces/codefresh/pods/cf-cfapi-base-****-/ | jq
997
+
```
998
+
999
+
Custom Metrics Call
1000
+
1001
+
```
1002
+
kubectl get --raw /apis/custom.metrics.k8s.io/v1beta1/namespaces/codefresh/services/cf-cfapi/requests_per_pod | jq
1003
+
```
1004
+
1005
+
## Upgrade the Codefresh Platform
726
1006
727
1007
To upgrade Codefresh to a newer version
728
1008
@@ -741,7 +1021,7 @@ Notice that only `kfci` should be used for Codefresh upgrades. If you still have
741
1021
742
1022
#### Mongo
743
1023
744
-
All services using the MongoDB are dependent on the `mongo` pod being up and running.If the `mongo` pod is down, the following dependencies will not work:
1024
+
All services using the MongoDB are dependent on the `mongo` pod being up and running. If the `mongo` pod is down, the following dependencies will not work:
- Autoscaling recommendations for Codefresh on-prem -[documentation]({{site.baseurl}}/docs/administration/codefresh-on-prem/#app-cluster-autoscaling)
24
26
- Hide inaccessible clusters in the Kubernetes dashboard -[documentation]({{site.baseurl}}/docs/deploy-to-kubernetes/manage-kubernetes/#accessing-the-kubernetes-dashboard)
25
27
- Define access for non-admins in Helm repositories and shared config -[documentation]({{site.baseurl}}/docs/configure-ci-cd-pipeline/shared-configuration/#level-of-access)
26
28
- Okta auto-sync of teams -[documentation]({{site.baseurl}}/docs/administration/single-sign-on/sso-okta/#syncing-of-teams-after-initial-sso-setup)