2017年第二屆廣東省強網杯線上賽WEB:Musee de X writeup(模板注入漏洞)
阿新 • • 發佈:2021-09-29
查詢幫助kubectl explain service
訪問叢集內的pod,帶selector的service
apiVersion: apps/v1 kind: Deployment metadata: name: flask namespace: default spec: replicas: 2 selector: matchLabels: app: flask template: metadata: labels: app: flask spec: restartPolicy: Always nodeName: hdss7-21.host.com containers: - name: flask image: flask imagePullPolicy: IfNotPresent ports: - name: indexport containerPort: 5000 --- apiVersion: v1 kind: Service metadata: name: flask namespace: default spec: selector: app: flask ports: - protocol: TCP port: 80 targetPort: 5000
訪問k8s 叢集外的應用,手動定義endpoint
apiVersion: v1 kind: Service metadata: name: endpoint1 namespace: default spec: ports: - protocol: TCP port: 80 targetPort: 3306 --- apiVersion: v1 kind: Endpoints metadata: name: endpoint1 subsets: - addresses: - ip: 10.4.7.200 ports: - port: 3306
不使用kube-proxy的排程策略 headless型別service
apiVersion: v1
kind: Service
metadata:
name: flask
namespace: defalut
spec:
clusterIP: None
selector:
app: flask
ports:
- protocol: TCP
port: 80
targetPort: 5000
session 親和性