mirror of
https://github.com/acedemand/kubernetes-essentials.git
synced 2021-08-24 18:29:57 +03:00
yamls created
This commit is contained in:
BIN
06-services/intro/.kuard-pod.yaml.swp
Normal file
BIN
06-services/intro/.kuard-pod.yaml.swp
Normal file
Binary file not shown.
@@ -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
|
||||
```
|
||||
|
||||
40
06-services/intro/kuard-deployment.yaml
Normal file
40
06-services/intro/kuard-deployment.yaml
Normal 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: {}
|
||||
19
06-services/intro/kuard-dpl-svc.yaml
Normal file
19
06-services/intro/kuard-dpl-svc.yaml
Normal 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: {}
|
||||
21
06-services/intro/kuard-pod-svc-lb.yaml
Normal file
21
06-services/intro/kuard-pod-svc-lb.yaml
Normal 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: {}
|
||||
21
06-services/intro/kuard-pod-svc-np.yaml
Normal file
21
06-services/intro/kuard-pod-svc-np.yaml
Normal 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: {}
|
||||
21
06-services/intro/kuard-pod-svc.yaml
Normal file
21
06-services/intro/kuard-pod-svc.yaml
Normal 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: {}
|
||||
35
06-services/intro/kuard-pod.yaml
Normal file
35
06-services/intro/kuard-pod.yaml
Normal 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
|
||||
Reference in New Issue
Block a user