Getting Started with Application Configuration Service for VMware Tanzu

This topic describes how to quickly get started using Application Configuration Service for VMware Tanzu (ACS) to provide centralized configuration properties for a microservice architecture.

This will give an overview of managing route configurations for applications providing application configuration via ACS. This overview assumes that ACS has already been installed.

Create Configuration Resources

Create a ClusterConfigProvider and a ConfigurationSlice named “my-config-slice”.

For more information about creating a configuration resources, see Create a Config Server Instance.

Deploy Client App

In this section we will describe a sample scenario for an application named “K8s-Kafe”. The following YAML describes the backend application deployment as a service on Kubernetes. For sake of the example we will assume that the target namespace is k8s-cafe on the Kubernetes cluster.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: k8s-kafe-deploy
  labels:
    app: k8s-kafe
spec:
  replicas: 1
  selector:
    matchLabels:
      app: k8s-kafe
  template:
    metadata:
      labels:
        app: k8s-kafe
    spec:
      containers:
      - name: k8s-kafe-container
        image: demo/k8s-kafe:0.0.1-SNAPSHOT
        env:
        - name: SPRING_CONFIG_IMPORT
          value: "configtree:/etc/config/"
        livenessProbe:
          initialDelaySeconds: 2
          periodSeconds: 5
          httpGet:
            path: /actuator/health/liveness
            port: 8080
        readinessProbe:
          initialDelaySeconds: 2
          periodSeconds: 5
          httpGet:
            path: /actuator/health/readiness
            port: 8080
        volumeMounts:
        - name: cook-config
          mountPath: /etc/config
      volumes:
      - name: cook-config
        configMap:
          name: cook-config-slice
---
apiVersion: v1
kind: Service
metadata:
  name: k8s-kafe-svc
  labels:
    app: k8s-kafe
spec:
  type: NodePort
  ports:
  - port: 31234
    nodePort: 30123
    targetPort: 8080
    protocol: TCP
    name: http
  selector:
    app: k8s-kafe

This assumes there is an image available in your container image repository named demo/k8s-kafe. To deploy the application, save the YAML into a file named k8s-kafe.yml and run the following command.

$ kubectl apply -f k8s-kafe.yml --namespace k8s-kafe