diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/404.html b/404.html new file mode 100644 index 00000000..1af1e67c --- /dev/null +++ b/404.html @@ -0,0 +1,5357 @@ + + + +
+ + + + + + + + + + + + + + +Create namespace
+kubectl create namespace eck
+
Add elastic Helm
+helm repo add elastic https://helm.elastic.co
+
Install ES
+helm install -n eck elasticsearch elastic/elasticsearch -f helm/es-config.yaml
+
Install Kibana
+helm install -n eck kibana elastic/kibana -f helm/kb-config.yaml
+
Install filebeat
+helm install -n eck filebeat elastic/filebeat --version 7.8.1 -f helm/filebeat-config.yaml
+
Kafka
+Apply Kafka
+kubectl create namespace kafka-strimzi-18
+kubectl apply -k strimzi/overlays/kafka-strimzi-18
+
NAMESPACE NAME READY STATUS RESTARTS AGE
+eck elasticsearch-master-0 1/1 Running 0 14h
+eck kibana-kibana-55f4bc96f5-7fz65 1/1 Running 0 14h
+kafka-strimzi-18 kafka-connect-sink-connect-847cfbf66-gwtkl 1/1 Running 0 7h27m
+kafka-strimzi-18 kafka-connect-source-connect-57bf7974f7-sz8ww 1/1 Running 0 7h27m
+kafka-strimzi-18 my-cluster-entity-operator-579cdc77bc-v6rxt 3/3 Running 5 14h
+kafka-strimzi-18 my-cluster-kafka-0 2/2 Running 0 14h
+kafka-strimzi-18 my-cluster-kafka-1 2/2 Running 0 14h
+kafka-strimzi-18 my-cluster-kafka-2 2/2 Running 2 14h
+kafka-strimzi-18 my-cluster-zookeeper-0 1/1 Running 0 14h
+kafka-strimzi-18 strimzi-cluster-operator-6c9d899778-nkd9q 1/1 Running 0 14h
+kube-system kube-dns-869d587df7-7whsm 3/3 Running 0 14h
+kube-system kube-dns-869d587df7-z659j 3/3 Running 0 14h
+kube-system kube-dns-autoscaler-645f7d66cf-r9ttj 1/1 Running 0 14h
+kube-system kube-proxy-gke-my-gke-cluster-my-gke-cluster-nod-9dff1786-x4wz 1/1 Running 0 14h
+kube-system kube-proxy-gke-my-gke-cluster-my-gke-cluster-pre-19639e01-7jsz 1/1 Running 0 93s
+kube-system kube-proxy-gke-my-gke-cluster-my-gke-cluster-pre-19639e01-cnl2 1/1 Running 0 14h
+kube-system kube-proxy-gke-my-gke-cluster-my-gke-cluster-pre-19639e01-f6cb 1/1 Running 0 14h
+kube-system kube-proxy-gke-my-gke-cluster-my-gke-cluster-pre-19639e01-vw9d 1/1 Running 0 14h
+kube-system l7-default-backend-678889f899-fvswg 1/1 Running 0 14h
+kube-system metrics-server-v0.3.6-7b7d6c7576-msl8x 2/2 Running 0 14h
+
Prometheus & Grafana
+git clone https://github.com/coreos/kube-prometheus.git && kube-prometheus
+
kubectl apply -f manifests/setup
+
wait a few minutes
+kubectl create -f manifests
+
Add strimzi monitoring
+kubectl apply -f strimzi/monitoring/prometheus-prometheus.yaml,strimzi/monitoring/prometheus-clusterRole.yaml
+
Add elasticsearch monitoring
+kubectl get pod --all-namespaces
+NAMESPACE NAME READY STATUS RESTARTS AGE
+eck elasticsearch-master-0 1/1 Running 0 3d3h
+eck kibana-kibana-55f4bc96f5-7fz65 1/1 Running 0 3d4h
+kafka-strimzi-18 kafka-connect-sink-connect-75db959966-sxqxx 1/1 Running 0 43m
+kafka-strimzi-18 kafka-connect-source-connect-6bc6d8797c-rr2x2 1/1 Running 0 42m
+kafka-strimzi-18 my-cluster-entity-operator-579cdc77bc-v6rxt 3/3 Running 0 3d4h
+kafka-strimzi-18 my-cluster-kafka-0 2/2 Running 0 2d13h
+kafka-strimzi-18 my-cluster-kafka-1 2/2 Running 0 2d13h
+kafka-strimzi-18 my-cluster-kafka-2 2/2 Running 0 2d13h
+kafka-strimzi-18 my-cluster-zookeeper-0 1/1 Running 50 2d1h
+kafka-strimzi-18 my-cluster-zookeeper-1 1/1 Running 16 2d1h
+kafka-strimzi-18 my-cluster-zookeeper-2 1/1 Running 0 2d1h
+kafka-strimzi-18 strimzi-cluster-operator-6c9d899778-nkd9q 1/1 Running 0 3d4h
+kube-system kube-dns-869d587df7-7whsm 3/3 Running 0 3d4h
+kube-system kube-dns-869d587df7-z659j 3/3 Running 0 3d4h
+kube-system kube-dns-autoscaler-645f7d66cf-r9ttj 1/1 Running 0 3d4h
+kube-system kube-proxy-gke-my-gke-cluster-my-gke-cluster-nod-9dff1786-x4wz 1/1 Running 0 3d4h
+kube-system kube-proxy-gke-my-gke-cluster-my-gke-cluster-pre-19639e01-7jsz 1/1 Running 0 2d13h
+kube-system kube-proxy-gke-my-gke-cluster-my-gke-cluster-pre-19639e01-cnl2 1/1 Running 0 3d4h
+kube-system kube-proxy-gke-my-gke-cluster-my-gke-cluster-pre-19639e01-f6cb 1/1 Running 0 3d4h
+kube-system kube-proxy-gke-my-gke-cluster-my-gke-cluster-pre-19639e01-vw9d 1/1 Running 0 3d4h
+kube-system l7-default-backend-678889f899-fvswg 1/1 Running 0 3d4h
+kube-system metrics-server-v0.3.6-7b7d6c7576-msl8x 2/2 Running 0 3d4h
+monitoring alertmanager-main-0 2/2 Running 0 13h
+monitoring alertmanager-main-1 2/2 Running 0 13h
+monitoring alertmanager-main-2 2/2 Running 0 13h
+monitoring grafana-58dc7468d7-vnsbh 1/1 Running 0 13h
+monitoring kube-state-metrics-765c7c7f95-fhkls 3/3 Running 0 13h
+monitoring node-exporter-bjq6x 2/2 Running 0 13h
+monitoring node-exporter-d7dx8 2/2 Running 0 13h
+monitoring node-exporter-ddmxd 2/2 Running 0 13h
+monitoring node-exporter-mj6tx 2/2 Running 0 13h
+monitoring node-exporter-psf45 2/2 Running 0 13h
+monitoring prometheus-adapter-5cd5798d96-fkd75 1/1 Running 0 13h
+monitoring prometheus-k8s-0 3/3 Running 1 12h
+monitoring prometheus-k8s-1 3/3 Running 1 12h
+monitoring prometheus-operator-5f75d76f9f-xtgqz 1/1 Running 0 2d5h
+
Enable the cluster operator to watch the other namespace
++ - strimzi-0.18.0/install/cluster-operator/050-Deployment-strimzi-cluster-operator.yaml
+
kubectl apply -k strimzi/overlays/kafka-strimzi-18
+
Deploy new Kafka
cluster and KafkaMirrorMaker2
in the other namespace kafka-strimzi-18-staging
kubectl apply -k strimzi/overlays/kafka-strimzi-18-staging
+
Clean up
+kubectl delete -k strimzi/overlays/kafka-strimzi-18-staging
+
Install metrics-server
+kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
+
Apply an apache application
+kubectl apply -f https://k8s.io/examples/application/php-apache.yaml
+
Set autoscale by kubectl
+kubectl autoscale deployment php-apache --cpu-percent=50 --min=1 --max=10
+
Increase load -> confirm HPA is working
+kubectl run -i --tty load-generator --rm --image=busybox --restart=Never -- /bin/sh -c "while sleep 0.01; do wget -q -O- http://php-apache; done"
+
kubectl get hpa
+
+NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE
+php-apache Deployment/php-apache 76%/50% 1 10 7 4m10s
+
Steps:
+kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/master/bundle.yaml
+
kubectl create ns monitoring; kubectl apply -k prometheus-operator -n monitoring
+
kubectl apply -f autoscaler/hpa/custom-metrics/rabbitmq/rabbitmq-cluster.yaml
+kubectl apply -f autoscaler/hpa/custom-metrics/rabbitmq/pod-monitor-rabbitmq.yaml
+
kubectl apply -f autoscaler/hpa/custom-metrics/rabbitmq-producer-cronjob.yaml
+
kubectl apply -f autoscaler/hpa/custom-metrics/rabbitmq-consumer-deployment.yaml
+
cd autoscaler/hpa/custom-metrics/k8s-prom-hpa
+touch metrics-ca.key metrics-ca.crt metrics-ca-config.json
+make certs
+cd -
+kubectl create -f autoscaler/hpa/custom-metrics/k8s-prom-hpa/custom-metrics-api
+
kubectl apply -f autoscaler/hpa/custom-metrics/rabbitmq-consumer-hpa.yaml
+
Using KUTTL to test the behaviors of yamls
+test
. e.g. prometheus-operator
TestStep
in the directory.kubectl kuttl test --start-kind=false
+
https://github.com/actions-runner-controller/actions-runner-controller
+ + + + + + + + + +kubectl create namespace argocd
+kubectl apply -k setup # v1.21 or later
+# kubectl kustomize setup | kubectl apply -f - # before v1.21
+
Check all the pods are running
+kubectl get pod -n argocd
+NAME READY STATUS RESTARTS AGE
+argocd-application-controller-0 1/1 Running 0 90s
+argocd-applicationset-controller-547665bdfd-rjgvm 1/1 Running 0 94s
+argocd-dex-server-865966bc45-s6fgf 1/1 Running 0 94s
+argocd-notifications-controller-c47c9f869-2smdk 1/1 Running 0 93s
+argocd-redis-896595fb7-h9pmr 1/1 Running 0 93s
+argocd-repo-server-678c6cc99c-kkzmd 1/1 Running 0 93s
+argocd-server-96cdb4df5-mxsq2 1/1 Running 0 92s
+
kubectl -n argocd port-forward service/argocd-server 8080:80
+
admin
kubectl get secret argocd-initial-admin-secret -n argocd -o jsonpath='{.data.password}' | base64 --decode
(v1.9.0 or later, there's a secret for initial admin password.)dev
Application: guestbook-kustomize-dev
.
Deploy application with ArgoCD
+kubectl apply -f project/dev
+
Check in console
+kubectl get pod -n dev
+NAME READY STATUS RESTARTS AGE
+dev-kustomize-guestbook-ui-7574c75879-6cfnq 1/1 Running 0 95s
+
Check on ArgoCD
+ +kubectl apply -f project/argocd/project.yaml,project/argocd/app-argocd.yaml
+
kubectl delete -f project/dev
+kubectl delete -k setup
+kubectl delete ns argocd
+
Github: https://github.com/argoproj-labs/argocd-notifications +Docs: https://argocd-notifications.readthedocs.io/en/stable/
+ArgoCD is installed.
+Install
+kubectl apply -k setup-notifications/base
+
Clean up
+kubectl delete -k setup-notifications/base
+
kubectl apply -f project/argocd/project.yaml,project/argocd/app-argocd-notifications.yaml
+
Install
+helm repo add argo https://argoproj.github.io/argo-helm
+helm install argo/argocd-notifications --generate-name -n argocd -f argocd/setup-notification-with-helm/value.yaml
+
failed:
+Error: YAML parse error on argocd-notifications/templates/configmap.yaml: error converting YAML to JSON: yaml: line 15: did not find expected key
+
https://github.com/argoproj/argo-helm/issues/616 → fixed in https://github.com/argoproj-labs/argocd-notifications/pull/315
+https://argocd-notifications.readthedocs.io/en/stable/services/slack/
+chat:write:bot
permission.#argocd-notifications
)./invite @<your-app-name>
)Kustomize:
+Prepare Secret argocd-notifications-secret
(setup-notifications/overlays/slack/argocd-notification-secret.yaml
)
+
cp setup-notifications/overlays/slack/argocd-notification-secret-sample.yaml setup-notifications/overlays/slack/argocd-notification-secret.yaml
+
Fill your Slack token.
+Prepare argocd-notifications-cm
(setup-notifications/overlays/slack/argocd-notification-cm.yaml
)
context
subscriptions
service.slack
kubectl patch app <my-app> -n argocd -p '{"metadata": {"annotations": {"notifications.argoproj.io/subscribe.on-sync-succeeded.slack":"<my-channel>"}}}' --type merge
+
kubectl apply -k setup-notifications/overlays/slack
+
helm install argo/argocd-notifications --generate-name -n argocd -f setup-notification-with-helm/value.yaml --set secret.items.slack-token=<SLACK BOT TOKEN>
+
{"use strict";/*!
+ * escape-html
+ * Copyright(c) 2012-2013 TJ Holowaychuk
+ * Copyright(c) 2015 Andreas Lubbe
+ * Copyright(c) 2015 Tiancheng "Timothy" Gu
+ * MIT Licensed
+ */var _a=/["'&<>]/;Pn.exports=Aa;function Aa(e){var t=""+e,r=_a.exec(t);if(!r)return t;var o,n="",i=0,s=0;for(i=r.index;i