Created
March 4, 2023 05:31
-
-
Save ZiaUrRehman786/fdd2e510b3beeb86109a823c7b4f9cbb to your computer and use it in GitHub Desktop.
cronjob-without-istio-sidecare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
labels: | |
istio.io/rev: asm-managed | |
run: nginx | |
name: nginx | |
--- | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: nginx | |
namespace: nginx | |
labels: | |
app.kubernetes.io/name: proxy | |
spec: | |
containers: | |
- name: nginx | |
image: nginx:stable | |
resources: | |
limits: | |
memory: "128Mi" | |
cpu: "500m" | |
ports: | |
- containerPort: 80 | |
name: http-web-svc | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: nginx-service | |
namespace: nginx | |
spec: | |
selector: | |
app.kubernetes.io/name: proxy | |
ports: | |
- name: name-of-service-port | |
protocol: TCP | |
port: 80 | |
targetPort: http-web-svc | |
--- | |
apiVersion: batch/v1 | |
kind: CronJob | |
metadata: | |
name: curl-nginx | |
namespace: nginx | |
spec: | |
schedule: "*/3 * * * *" | |
successfulJobsHistoryLimit: 2 | |
failedJobsHistoryLimit: 1 | |
jobTemplate: | |
spec: | |
template: | |
metadata: | |
annotations: | |
sidecar.istio.io/inject: "false" | |
spec: | |
containers: | |
- name: nginx-curl | |
image: curlimages/curl:latest | |
args: | |
- /bin/sh | |
- -c | |
- curl -sS --show-error http://nginx-service.nginx; | |
restartPolicy: OnFailure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment