真题环境模拟

创建 Dockerfile

# vim Dockerfile
FROM ubuntu:latest

USER root
RUN apt-get install nginx -y
ENTRYPOINT ["/sunnydale.sh"]
USER root
CMD ["./sunnydale.sh"]

创建 Deployment yaml

# vim deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    app: test
  name: test
spec:
  replicas: 1
  selector:
    matchLabels:
      app: test
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: test
    spec:
      containers:
      - image: redis
        name: redis
        resources: {}
        securityContext:
          {'Capabilities': {'add':{NET_ADMIN}, 'drop':['all']}, 'privileged': True, 'readOnlyRootFilesystem': False, 'runAsUser': 65535}
status: {}

Last updated