weixin_39962770 2020-11-20 15:34
浏览 0

Configure staging environment

Currently, the changes will be deployed onto production server after merging pull request to production branch. Ideally, the PR should be deployed to pre-production environment after merging to master branch so that the developer can preview & verify the changes.

该提问来源于开源项目:short-d/short

  • 写回答

5条回答 默认 最新

  • weixin_39962770 2020-11-20 15:34
    关注

    Here are the kubenetes configs for staging environment

    yaml
    # staging-namespace.yaml
    apiVersion: v1
    kind: Namespace
    metadata:
      name: staging
    
    yaml
    # frontend-pod.staging.yaml
    apiVersion: v1
    kind: Pod
    metadata:
      name: short-frontend
      namespace: staging
      labels:
        app: short
        tier: frontend
    spec:
      containers:
        - name: short-frontend
          image: byliuyang/short-frontend
          imagePullPolicy: IfNotPresent
      restartPolicy: Always
    
    yaml
    # frontend-service.staging.yaml
    apiVersion: v1
    kind: Service
    metadata:
      namespace: staging
      name: short-frontend
    spec:
      selector:
        app: short
        tier: frontend
      ports:
        - port: 80
    
    yaml
    # frontend-ingress.staging.yaml
    apiVersion: networking.k8s.io/v1beta1
    kind: Ingress
    metadata:
      namespace: staging
      name: short-frontend
    spec:
      tls:
        - hosts:
            - staging.short-d.com
          secretName: short-d.com-tls
      rules:
        - host: staging.short-d.com
          http:
            paths:
              - backend:
                  serviceName: short-frontend
                  servicePort: 80 
    
    评论

报告相同问题?