苍穹容器服务迁移

栏目:云苍穹知识作者:金蝶来源:金蝶云社区发布:2024-09-23浏览:1

苍穹容器服务迁移

1 导出yaml配置文件

源环境导出部署及服务的yaml文件。mc服务为例:

kubectl get deployment mc -n kingdee -o yaml > mc-deployment.yaml
kubectl get svc mc -n kingdee -o yaml > mc-svc.yaml


2 修改导出的YAML文件

根据新环境相应信息,修改其中的namespace,集群名称clusterName,WEB_PORT,configUrl,APPSTORE_URL信息。

[root@ierp01 zyp]# cat mc-deployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  annotations:
    com.kingdee.kcs.clusterenv: ""
    com.kingdee.kcs.deploytime: "1593757379"
    deployment.kubernetes.io/revision: "7"
  creationTimestamp: "2020-05-28T15:53:59Z"
  finalizers:
  - foregroundDeletion
  generation: 14
  labels:
    cluster: kingdee
  name: mc
  namespace: kingdee
  resourceVersion: "26415891"
  selfLink: /apis/extensions/v1beta1/namespaces/kingdee/deployments/mc
  uid: 71c79654-a0fb-11ea-a200-0050563afb48
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 2
  selector:
    matchLabels:
      app: mc
      cluster: kingdee
      sname: mc
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      annotations:
        com.kingdee.kcs.zid: "1"
      creationTimestamp: "2020-07-03T06:22:59Z"
      labels:
        app: mc
        cluster: kingdee
        sname: mc
    spec:
      containers:
      - env:
        - name: clusterName
          value: mc
        - name: configUrl
          value: 172.16.60.131:2181,172.16.60.132:2181,172.16.60.133:2181
        - name: appSplit
          value: "false"
        - name: APPSTORE_URL
          value: http://172.20.177.36:8090/appstore/mc
        - name: WEB_PORT
          value: "8080"
        - name: JVM_OPTS
          value: -server -Xms1536m -Xmx2048m -Xss256k -XX:MaxMetaspaceSize=256m -XX:NativeMemoryTracking=summary
            -Duser.timezone=GMT+8 -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError
            -XX:HeapDumpPath=../logs/dump.%t.hprof -XX:+PrintGCApplicationStoppedTime
            -XX:+DisableExplicitGC -XX:+UseG1GC -XX:+PrintAdaptiveSizePolicy -XX:+PrintGCDetails
            -XX:+PrintGCDateStamps -Xloggc:../logs/gc.%t.log -DdataCenterName=mc
        - name: webmserviceinone
          value: "true"
        - name: configAppName
          value: mservice
        - name: isMC
          value: "true"
        - name: appName
          value: mc
        - name: is_unzip_dm_before_upgrade
          value: "false"
        - name: domain_contextUrl
          value: http://172.20.177.36:8090/mc/
        - name: bgdeploy_enable
          value: "true"
        - name: lightweightdeploy
          value: "false"
        - name: JETTY_CONTEXT
          value: ierp
        image: kcr.kingdee.com/support/v2.0/mservice:v-20191220
        imagePullPolicy: IfNotPresent
        name: mc
        ports:
        - containerPort: 8080
          protocol: TCP
        resources:
          limits:
            cpu: "1"
            memory: 3000Mi
          requests:
            cpu: 100m
            memory: 3000Mi
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      hostAliases:
      - hostnames:
        - api.kingdee.com
        ip: 172.20.110.37
      imagePullSecrets:
      - name: secret-0-1
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
status:
  availableReplicas: 1
  conditions:
  - lastTransitionTime: "2020-06-28T08:30:34Z"
    lastUpdateTime: "2020-06-28T08:30:34Z"
    message: Deployment has minimum availability.
    reason: MinimumReplicasAvailable
    status: "True"
    type: Available
  - lastTransitionTime: "2020-05-28T15:53:59Z"
    lastUpdateTime: "2020-07-03T06:23:04Z"
    message: ReplicaSet "mc-6898478c6f" has successfully progressed.
    reason: NewReplicaSetAvailable
    status: "True"
    type: Progressing
  observedGeneration: 14
  readyReplicas: 1
  replicas: 1
  updatedReplicas: 1

  

[root@ierp01 zyp]# cat mc-svc.yaml
apiVersion: v1
kind: Service
metadata:
  creationTimestamp: "2020-01-14T01:14:18Z"
  labels:
    app: mc
    name: mc
  name: mc
  namespace: kingdee
  resourceVersion: "2816285"
  selfLink: /api/v1/namespaces/kingdee/services/mc
  uid: 301b3a80-366b-11ea-a499-0050563afb48
spec:
  clusterIP: 10.24.255.24
  externalTrafficPolicy: Cluster
  ports:
  - name: kcs-service-0
    nodePort: 30001
    port: 8080
    protocol: TCP
    targetPort: 8080
  selector:
    app: mc
    cluster: kingdee
    sname: mc
  sessionAffinity: None
  type: NodePort
status:
  loadBalancer: {}

3 导入容器服务

目标环境导入容器服务。

kubectl create -f mc-deployment.yaml
kubectl create -f mc-svc.yaml


苍穹容器服务迁移

1 导出yaml配置文件源环境导出部署及服务的yaml文件。以mc服务为例:kubectl get deployment mc -n kingdee -o yaml > mc-deployment.yaml...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息