6 Ocak 2025 Pazartesi

Kubernetes kind: Cluster

Örnek
Şöyle yaparız
apiVersion: cluster.k8s.io/v1alpha1
kind: Cluster
metadata:
  name: my-cluster
spec:
  autoscaler:
    enabled: true
    options:
      - key: balance-similar-node-groups
        value: true
      - key: expander
        value: least-waste
Açıklaması şöyle
This configuration enables the cluster autoscaler and sets it to balance similar node groups and use the least-waste expander, which helps in utilizing the reserved instances more effectively. 

16 Aralık 2024 Pazartesi

kubectl describe ingress seçeneği

Giriş
Açıklaması şöyle
This command shows configuration details and associated events. Look for configuration errors, missing SSL certificates, or routing issues.
Söz dizimi şöyle
kubectl describe ingress <ingress-name> -n <namespace-name>

kubectl describe node seçeneği

Giriş
Açıklaması şöyle
This command provides details on why a node might be NotReady, such as memory issues, disk pressure, or taints not tolerated by the pods, pods running on the nodes, label... It’s a powerful command that will help you to get detailed informations about nodes.

27 Kasım 2023 Pazartesi

Cluster Propotional Autoscaler - ReplicaSet Ekler/Siler

Giriş
Açıklaması şöyle
CPA aims to horizontally scale the number of Pod replicas based on the cluster’s scale. A common example is DNS services. CPA can dynamically adjust the number of DNS instances based on the current cluster scale, which can be either the number of nodes or the overall CPU capacity.

2 Ekim 2023 Pazartesi

Kubernetes kind: Role

Örnek
Elimizde şöyle bir Role olsun. Bu Role pods ve configmaps kaynaklarını watch, get vs yapabilir. Yani izleyebilir.
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: leader
  labels:
    app: kubernetes-leader-election-example
    group: org.springframework.cloud
rules:
- apiGroups:
  - ""
  resources:
  - pods
  verbs:
  - watch
  - get
- apiGroups:
  - ""
  resources:
  - configmaps
  verbs:
  - watch
  - get
  - update
  # resourceNames:
  #   - <config-map name>
Bu Rolü kendime atarım
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  labels:
    app: kubernetes-leader-election-example
    group: org.springframework.cloud
  name: leader
roleRef:
  apiGroup: ""
  kind: Role
  name: leader
subjects:
- kind: ServiceAccount
  name: default
  apiGroup: ""


18 Eylül 2023 Pazartesi

Kubernetes kind: Pod dnsConfig

Giriş
Açıklaması şöyle
To change the behavior of a pod’s DNS resolver, you can change the DNS config of a pod
Örnek
Şöyle yaparız
apiVersion: v1
kind: Pod
metadata:
  namespace: default
  name: dns-example
spec:
  containers:
    - name: test
      image: nginx
  dnsPolicy: "None"
  dnsConfig:
    nameservers:
      - 1.2.3.4
    searches:
      - ns1.svc.cluster-domain.example
      - my.dns.search.suffix
    options:
      - name: ndots
        value: "2"
      - name: edns0
Açıklaması şöyle
In the example above, the dnsPolicy is set to "None", which means that the pod will not use the default DNS settings provided by the cluster. Instead, the dnsConfig field is used to specify custom DNS settings for the pod.

The nameservers field is used to specify the DNS servers that the pod should use for DNS lookups. The searches field is used to specify the search domains that should be used for incomplete domains.

The options field is used to specify custom options for the DNS resolver, such as the ndots and edns0 options in the example above.

These settings will be used by the pod’s DNS resolver instead of the default settings provided by the cluster. For more information on pod DNS configuration, see the official docs.

Kubernetes kind: Cluster

Örnek Şöyle yaparız apiVersion: cluster.k8s.io/v1alpha1 kind: Cluster metadata: name: my-cluster spec: autoscaler: enabled: true ...