Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用deploymane来模拟daemonset | 打工笔记 #39

Open
utterances-bot opened this issue May 15, 2022 · 3 comments
Open

使用deploymane来模拟daemonset | 打工笔记 #39

utterances-bot opened this issue May 15, 2022 · 3 comments
Labels
utterance utterance

Comments

@utterances-bot
Copy link

使用deploymane来模拟daemonset | 打工笔记

打工笔记

https://amrom66.github.io/2022/2022-05-12-use-deployment-simuator-daemonset/

@linjinbao666 linjinbao666 added the utterance utterance label May 15, 2022 — with utterances
Copy link
Member

apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    id: very-important
  name: deploy-important
  namespace: project-tiger
spec:
  replicas: 3
  selector:
    matchLabels:
      id: very-important
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        id: very-important
    spec:
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - topologyKey: kubernetes.io/hostname
            labelSelector:
              matchExpressions:
              - key: id
                operator: In
                values:
                - very-important 
      containers:
      - image: nginx:1.17.6-alpine
        imagePullPolicy: Never
        name: container1
        resources: {}
      - name: container2
        image: kubernetes/pause
status: {}

Copy link
Member

apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    run: secret-pod
  name: secret-pod
  namespace: secret
spec:
  containers:
  - image: busybox:1.31.1
    name: secret-pod
    env:
    - name: APP_USER
      valueFrom:
        secretKeyRef:
          name: secret2
          key: user
    - name: APP_PASS
      valueFrom:
        secretKeyRef:
          name: secret2
          key: pass
    command:
    - "sh"
    - "-c"
    - "sleep 3600"
    volumeMounts:
    - name: foo
      mountPath: /tmp/secret1
    resources: {}
  dnsPolicy: ClusterFirst
  restartPolicy: Always
  tolerations:
  - effect: NoSchedule
    operator: Exists
  - effect: NoExecute
    operator: Exists
  volumes:
  - name: foo
    secret:
      secretName: secret1 
  tolerations:
  - effect: NoSchedule
    operator: Exists
    key: node-role.kubernetes.io/master
status: {}

Copy link
Member

kubectl -n secret create secret generic secret3 --from-literal=user=user1 --from-literal=pass=1234

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
utterance utterance
Projects
None yet
Development

No branches or pull requests

2 participants