Updated on 2025-08-12 GMT+08:00

Deploying WordPress Using ccictl

CCI 2.0 provides ccictl, a tool that allows you to have a better experience than the console or APIs when creating workloads.

Constraints

ccictl has been connected to CCI 2.0.

Procedure

For the WordPress application, you can use ccictl to create resources.

  1. Create a namespace.

    ccictl create namespace cci-test
    Figure 1 Example command output for creating a namespace

  2. Run ccictl create -f network.yaml to create a network. The following is an example YAML file:

    apiVersion: yangtse/v2
    kind: Network
    metadata:
      annotations:
        yangtse.io/domain-id: ${domain-id}
        yangtse.io/project-id: ${project-id}
      name: cci-network
      namespace: cci-test
    spec:
      networkType: underlay_neutron
      securityGroups:
        - ${security-group-id}
      subnets:
        - subnetID: ${subnet-id}
    Figure 2 Example command output for creating a network

  3. Run ccictl apply -f deployment.yaml to create the wordpress workload. The following is an example YAML file:

    kind: Deployment
    apiVersion: cci/v2
    metadata:
      name: wordpress
      namespace: cci-test
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: wordpress
      template:
        metadata:
          labels:
            app: wordpress
        spec:
          containers:
            - name: wordpress
              image: wordpress:latest
              ports:
              - containerPort: 80
              resources:
                limits:
                  cpu: 500m
                  memory: 1Gi
                requests:
                  cpu: 500m
                  memory: 1Gi
          dnsPolicy: Default
    Figure 3 Example command output for creating a workload

  4. Run ccictl apply -f service.yaml to create a Service for the workload. The following is an example YAML file:

    kind: Service
    apiVersion: cci/v2
    metadata:
      name: service-wordpress
      namespace: cci-test
      annotations:
        kubernetes.io/elb.class: elb
        kubernetes.io/elb.id: '${elb_id}' # ID of the associated dedicated load balancer, which must have an EIP bound
    spec:
      ports:
        - name: service-wordpress-port
          protocol: TCP
          port: 80
          targetPort: 80
      selector:
        app: wordpress
      type: LoadBalancer
    Figure 4 Example command output for creating a Service

  5. Use the EIP and port of the load balancer to access the WordPress application.