• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. User Guide 2.0
  4. Data Migration from an Earlier Version to the Latest Version
  5. Migrating an Application
  6. Applications Created Through App Designer

Applications Created Through App Designer

If the application in the earlier CCE version is created through App Designer, follow the steps in this section to migrate the application to the latest CCE version. In the current CCE version, use the custom Helm template to create applications. For more information, see Container Orchestration.

Figure 1 shows an example of an application created using App Designer in the earlier CCE version. For details about App Design in the earlier CCE version, see Creating a Graphical App Design.

Figure 1 Setting new-appcomponent-1
Figure 2 Setting new-container-2
Figure 3 Setting new-port-3

Procedure

  1. Log in to the console of the earlier CCE version. In the navigation pane, click App Manager. Then, click the name of the application to be migrated to go to the details page. Obtain Component Name and Service Name.

    For example, in Figure 1, Component Name and Service Name are new-appcomponent-1-11d3 and new-port-3, respectively.
    Figure 4 Obtaining the component name and service name

  2. Connect to the cluster. For details, see Connecting to a Kubernetes Cluster Using kubectl in the earlier CCE version.
  3. Run the following commands on the kubectl client to obtain the YAML files related to the application.

    kubectl get rc new-appcomponent-1-11d3 -o yaml > new-appcomponent-1-11d3.yaml

    kubectl get svc new-port-3 -o yaml > new-port-3.yaml

    In the preceding commands, replace new-appcomponent-1-11d3 and new-port-3 with the values obtained in 1.

  4. Edit the new-appcomponent-1-11d3.yaml file by deleting the lines in bold and modifying the lines in Italic.

    apiVersion: v1
    kind: ReplicationController
    metadata:
      annotations:
        cce/app-createTimestamp: 2018-04-19-11-39-27
        cce/app-description: ""
        cce/app-updateTimestamp: 2018-04-19-11-39-27
      creationTimestamp: 2018-04-19T11:37:17Z
      generation: 1
      labels:
        cce/appgroup: app-design
        name: new-appcomponent-1-11d3
        rollingupdate: "false"
      name: new-appcomponent-1-11d3
      namespace: default
      resourceVersion: "8325781"
      selfLink: /api/v1/namespaces/default/replicationcontrollers/new-appcomponent-1-11d3
      uid: 039ada96-43c6-11e8-8f34-fa163e738aa3
    spec:
      replicas: 1
      selector:
        cce/appgroup: app-design
        name: new-appcomponent-1-11d3
        rollingupdate: "false"
      template:
        metadata:
          annotations:
            scheduler.alpha.kubernetes.io/affinity: '{"nodeAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":{"nodeSelectorTerms":[{"matchExpressions":[{"key":"failure-domain.beta.kubernetes.io/zone","operator":"NotIn","values":[""]}]}]}}}'
          creationTimestamp: null
          labels:
            cce/appgroup: app-design
            name: new-appcomponent-1-11d3
            rollingupdate: "false"
        spec:
          affinity:
            nodeAffinity:
              requiredDuringSchedulingIgnoredDuringExecution:
                nodeSelectorTerms:
                - matchExpressions:
                  - key: failure-domain.beta.kubernetes.io/zone
                    operator: NotIn
                    values:
                    - ""
          containers:
          - image: 10.125.1.108:6443/test/apache-php:latest # Change it to the image address of the later CCE version
            imagePullPolicy: Always
            name: new-container-2-11d3f16
            ports:
            - containerPort: 3333
              protocol: TCP
            resources: {}
            securityContext:
              privileged: true
            terminationMessagePath: /dev/termination-log
            terminationMessagePolicy: File
          dnsPolicy: ClusterFirst
          imagePullSecrets:
          - name: myregistry # Change it to default-secret
          restartPolicy: Always
          schedulerName: default-scheduler
          securityContext: {}
          terminationGracePeriodSeconds: 30
    status:
      availableReplicas: 1
      fullyLabeledReplicas: 1
      observedGeneration: 1
      readyReplicas: 1
      replicas: 1

  5. Open the new-port-3.yaml file, and delete the lines in bold.

    apiVersion: v1
    kind: Service
    metadata:
      creationTimestamp: 2018-04-19T11:37:17Z
      labels:
        cce/appgroup: app-design
        name: new-appcomponent-1-11d3
      name: new-port-3
      namespace: default
      resourceVersion: "8325766"
      selfLink: /api/v1/namespaces/default/services/new-port-3
      uid: 039c918f-43c6-11e8-8f34-fa163e738aa3
    spec:
      clusterIP: 10.247.145.136
      externalTrafficPolicy: Cluster
      ports:
      - name: new-port-30
        nodePort: 31471
        port: 3333
        protocol: TCP
        targetPort: 3333
      selector:
        cce/appgroup: app-design
        name: new-appcomponent-1-11d3
      sessionAffinity: None
      type: NodePort
    status:
      loadBalancer: {}

  6. Connect the kubectl client to the cluster in the latest CCE version. For details, see Connecting to a Kubernetes Cluster Using kubectl.
  7. Run the following commands to create the application again:

    kubectl create -f new-appcomponent-1-11d3.yaml

    kubectl create -f new-port-3.yaml