add customize probe plugin for demo
@@ -47,6 +47,37 @@ spec:
}
---
apiVersion: core.kapp.dev/v1alpha1
+kind: Plugin
+metadata:
+ name: kapp-customize-probes
+spec:
+ src: |
+ function addProbesForContainer(container) {
+ if (!container.readinessProbe) {
+ container.readinessProbe = {};
+ }
+
+ container.readinessProbe.httpGet = {
+ path: "/",
+ port: 80
+ };
+
+ container.readinessProbe.initialDelaySeconds = 5;
+ container.readinessProbe.timeoutSeconds = 20;
+ container.readinessProbe.periodSeconds = 5;
+ container.readinessProbe.successThreshold = 1;
+ container.readinessProbe.failureThreshold = 3;
+ }
+
+ function AfterPodTemplateGeneration(pod) {
+ var containers = pod.spec.containers;
+ containers.forEach(addProbesForContainer)
+ return pod;
+ }
+ availableWorkloadType:
+ - server
+---
+apiVersion: core.kapp.dev/v1alpha1
kind: Application
metadata:
name: test-plugin-sample-application
@@ -63,5 +94,6 @@ spec:
workloadType: server
pluginsNew:
- name: kapp-scale-name-with-suffix-tiple
+ - name: kapp-customize-probes
- name: kapp-test-default-embedded-functions
isActive: true
\ No newline at end of file
