github.com/midokura/kubeedge@v1.2.0-mido.0/build/cloud/07-deployment.yaml (about)

     1  apiVersion: apps/v1
     2  kind: Deployment
     3  metadata:
     4    labels:
     5      k8s-app: kubeedge
     6      kubeedge: cloudcore
     7    name: cloudcore
     8    namespace: kubeedge
     9  spec:
    10    selector:
    11      matchLabels:
    12        k8s-app: kubeedge
    13        kubeedge: cloudcore
    14    template:
    15      metadata:
    16        labels:
    17          k8s-app: kubeedge
    18          kubeedge: cloudcore
    19      spec:
    20        initContainers:
    21        - name: kubeconfig
    22          image: alpine:3.9
    23          volumeMounts:
    24          - name: kubeconfig
    25            mountPath: /etc/kubeedge/cloud
    26            subPath: kubeconfig.yaml
    27          command:
    28          - /bin/sh
    29          - -c
    30          - |
    31            apk --no-cache add coreutils && cat | tee /etc/kubeedge/cloud/kubeconfig.yaml <<EOF
    32            apiVersion: v1
    33            kind: Config
    34            clusters:
    35            - name: kubeedge
    36              cluster:
    37                certificate-authority-data: $(cat /var/run/secrets/kubernetes.io/serviceaccount/ca.crt | base64 -w 0)
    38            users:
    39            - name: kubeedge
    40              user:
    41                token: $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
    42            contexts:
    43            - name: kubeedge
    44              context:
    45                cluster: kubeedge
    46                user: kubeedge
    47            current-context: kubeedge
    48            EOF
    49        containers:
    50        - name: cloudcore
    51          image: kubeedge/cloudcore:v1.1.0
    52          imagePullPolicy: IfNotPresent
    53          ports:
    54          - containerPort: 10000
    55            name: cloudhub
    56            protocol: TCP
    57          resources:
    58            limits:
    59              cpu: 200m
    60              memory: 1Gi
    61            requests:
    62              cpu: 100m
    63              memory: 512Mi
    64          volumeMounts:
    65          - name: conf
    66            mountPath: /etc/kubeedge/cloud/conf
    67          - name: certs
    68            mountPath: /etc/kubeedge/certs
    69          - name: kubeconfig
    70            mountPath: /etc/kubeedge/cloud
    71            subPath: kubeconfig.yaml
    72        restartPolicy: Always
    73        serviceAccount: cloudcore
    74        serviceAccountName: cloudcore
    75        volumes:
    76        - name: conf
    77          configMap:
    78            name: cloudcore
    79        - name: certs
    80          secret:
    81            secretName: cloudcore
    82        - name: kubeconfig
    83          emptyDir: {}