Skip to content

Instantly share code, notes, and snippets.

@spiarh
Created June 15, 2020 12:02
Show Gist options
  • Save spiarh/a1c8483bf6b2e9b37d678c99ed36bc86 to your computer and use it in GitHub Desktop.
Save spiarh/a1c8483bf6b2e9b37d678c99ed36bc86 to your computer and use it in GitHub Desktop.
---
apiVersion: apps/v1
kind: Deployment
metadata:
generation: 1
labels:
app: source-ip-app
name: source-ip-app
namespace: default
spec:
progressDeadlineSeconds: 600
replicas: 3
revisionHistoryLimit: 0
selector:
matchLabels:
app: source-ip-app
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
app: source-ip-app
spec:
containers:
- image: k8s.gcr.io/echoserver:1.4
imagePullPolicy: IfNotPresent
name: echoserver
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
---
apiVersion: v1
kind: Service
metadata:
labels:
app: source-ip-app
name: source-ip-nodeport
namespace: default
spec:
externalTrafficPolicy: Local
ports:
- nodePort: 31080
port: 80
protocol: TCP
targetPort: 8080
selector:
app: source-ip-app
sessionAffinity: None
type: NodePort
---
apiVersion: "cilium.io/v2"
kind: CiliumNetworkPolicy
description: "Allow ingress from outside"
metadata:
labels:
app: source-ip-app
name: source-ip-app-ingress
namespace: default
spec:
endpointSelector:
matchLabels:
app: source-ip-app
ingress:
#- {}
- fromCIDR:
- 192.168.0.1/32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment