yamls created

This commit is contained in:
Pamir Erdem
2018-10-01 10:33:29 +03:00
parent f208171c05
commit 03a68727e7
8 changed files with 199 additions and 0 deletions

Binary file not shown.

View File

@@ -26,3 +26,45 @@ overlay networking
ps -ef | grep cni
kubectl get svc -o wide -n kube-system | grep 10.19.240.10
```
```bash
#service types
kubectl apply -f kuard-pod.yaml
kubectl get pod -w
kubectl expose pod kuard --type=ClusterIP --dry-run=true -o yaml
kubectl expose pod kuard --type=ClusterIP -o yaml > kuard-pod-svc.yaml
kubectl delete svc kuard
kubectl expose pod kuard --type=NodePort --dry-run=true -o yaml > kuard-pod-svc-np.yaml
kubectl expose pod kuard --type=LoadBalancer --dry-run=true -o yaml > kuard-pod-svc-lb.yaml
#no endpoint
kubectl apply -f kuard-pod-svc.yaml
kubectl get endpoints
kubectl delete pod kuard
kubectl get endpoints
kubectl apply -f kuard-deployment.yaml
kubectl get endpoints
#edit svc kuard
kubectl edit svc kuard
kubectl get endpoints
```
#### NodePort
```bash
kubectl delete svc kuard
kubectl apply -f kuard-dpl-svc.yaml
kubectl get endpoints
kubectl scale deployment kuard --replicas=2
kubectl get endpoints -w
```
```yaml
ports:
- nodePort: 30792
port: 8080
protocol: TCP
targetPort: 8080
```

View File

@@ -0,0 +1,40 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
creationTimestamp: null
labels:
run: kuard
name: kuard
spec:
replicas: 1
selector:
matchLabels:
run: kuard
internalVersion: 0.0.1
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
run: kuard
internalVersion: 0.0.1
spec:
containers:
- image: gcr.io/kuar-demo/kuard-amd64:1
name: kuard
livenessProbe:
httpGet:
path: /healthy
port: 8080
initialDelaySeconds: 5
timeoutSeconds: 1
periodSeconds: 10
failureThreshold: 3
readinessProbe:
httpGet:
path: /ready
port: 8080
timeoutSeconds: 1
periodSeconds: 10
initialDelaySeconds: 30
status: {}

View File

@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
internalVersion: 0.0.1
run: kuard
name: kuard
spec:
ports:
- port: 8080
protocol: TCP
targetPort: 8080
selector:
internalVersion: 0.0.1
run: kuard
type: NodePort
status:
loadBalancer: {}

View File

@@ -0,0 +1,21 @@
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
internalVersion: 0.0.1
name: kuard
run: kuard
name: kuard
spec:
ports:
- port: 8080
protocol: TCP
targetPort: 8080
selector:
internalVersion: 0.0.1
name: kuard
run: kuard
type: LoadBalancer
status:
loadBalancer: {}

View File

@@ -0,0 +1,21 @@
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
internalVersion: 0.0.1
name: kuard
run: kuard
name: kuard
spec:
ports:
- port: 8080
protocol: TCP
targetPort: 8080
selector:
internalVersion: 0.0.1
name: kuard
run: kuard
type: NodePort
status:
loadBalancer: {}

View File

@@ -0,0 +1,21 @@
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
internalVersion: 0.0.1
name: kuard
run: kuard
name: kuard
spec:
ports:
- port: 8080
protocol: TCP
targetPort: 8080
selector:
internalVersion: 0.0.1
name: kuard
run: kuard
type: ClusterIP
status:
loadBalancer: {}

View File

@@ -0,0 +1,35 @@
apiVersion: v1
kind: Pod
metadata:
labels:
run: kuard
name: kuard
internalVersion: 0.0.1
name: kuard
spec:
containers:
- image: gcr.io/kuar-demo/kuard-amd64:1
imagePullPolicy: IfNotPresent
name: kuard
livenessProbe:
httpGet:
path: /healthy
port: 8080
initialDelaySeconds: 5
timeoutSeconds: 1
periodSeconds: 10
failureThreshold: 3
readinessProbe:
httpGet:
path: /ready
port: 8080
timeoutSeconds: 1
periodSeconds: 10
initialDelaySeconds: 30
ports:
- containerPort: 8080
name: http
protocol: TCP
resources: {}
dnsPolicy: ClusterFirst
restartPolicy: OnFailure