이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 2. Installing API controller


To install API controller use the community Operator.

Prerequisites

  • cluster-admin access to an OpenShift cluster.

Procedure

  1. In the OpenShift Container Platform web console, log in with cluster-admin privileges.
  2. In the left navigation menu, click Operators > OperatorHub.
  3. In the Filter by keyword text box, enter Apicurio to find the Apicurio API Controller.
  4. Read the information about the Operator, and click Install to display the Operator subscription page.
  5. Accept the default subscription settings noting the following:

    • Installation mode: All namespaces on the cluster (default).
    • Installed namespace: Select the namespace where you want to install the Operator, for example, api-controller. If the namespace does not already exist, click this field and select Create Project to create the namespace.
    • Approval Strategy: Select Automatic or Manual.
  6. Click Install, and wait a few moments until the Operator is installed and ready for use.
  7. Verify that the Operator is installed. After you have installed the Operator, click Operators > Installed Operators to verify that the Apicurio API Controller is installed in your selected namespace, for example api-controller.
  8. Change to the Developer view in the OpenShift Container Platform web console to apply the YAML required for installation.
  9. Create a PostgreSQL database using the following YAML in the api-controller namespace:

    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: registry-pvc
      namespace: api-controller
    spec:
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: 1Gi  # Adjust the storage size as needed
    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      namespace: "api-controller"
      labels:
        app: postgresql
      name: postgresql
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: postgresql
      template:
        metadata:
          labels:
            app: postgresql
        spec:
          initContainers:
            - name: init-data
              image: busybox
              command: ['sh', '-c', 'rm -rf /var/lib/postgresql/data/* && mkdir -p /var/lib/postgresql/data/pgdata']
              volumeMounts:
                - mountPath: "/var/lib/postgresql/data"
                  name: "registry-pgdata"
          containers:
            - name: postgresql
              image: quay.io/debezium/postgres:13-alpine
              ports:
                - containerPort: 5432
              env:
                - name: POSTGRES_DB
                  value: registry
                - name: POSTGRES_USER
                  value: apicurio
                - name: POSTGRES_PASSWORD
                  value: registry
                - name: PGDATA
                  value: "/var/lib/postgresql/data/pgdata"
              volumeMounts:
                - mountPath: "/var/lib/postgresql/data"
                  name: "registry-pgdata"
          volumes:
            - name: registry-pgdata
              persistentVolumeClaim:
                claimName: registry-pvc
    ---
    apiVersion: v1
    kind: Service
    metadata:
      namespace: "api-controller"
      labels:
        app: postgresql
      name: postgresql-service
    spec:
      ports:
        - name: http
          port: 5432
          protocol: TCP
          targetPort: 5432
      selector:
        app: postgresql
      type: ClusterIP
    Copy to Clipboard Toggle word wrap
  10. Create a CR named apicurio, and the required Routes using the following YAML in the api-controller namespace:

    Note

    Replace mycluster.example.com with your cluster hostname.

    # Replace mycluster.example.com with your cluster hostname
    # Create an API Controller custom resource
    apiVersion: registry.apicur.io/v1
    kind: ApicurioRegistry3
    metadata:
      name: apicurio
      namespace: api-controller
    spec:
      studioUi:
        enabled: true
        env:
          - name: APICURIO_REGISTRY_API_URL
            value: 'https://api-controller-app.apps.mycluster.example.com/apis/registry/v3'
          - name: APICURIO_REGISTRY_UI_URL
            value: 'https://api-controller-ui.apps.mycluster.example.com'
      ui:
        env:
          - name: REGISTRY_API_URL
            value: 'https://api-controller-app.apps.mycluster.example.com/apis/registry/v3'
      app:
        sql:
          dataSource:
            username: apicurio
            password: registry
            url: 'jdbc:postgresql://postgresql-service:5432/registry'
    ---
    # Create a route for the Apicurio Registry API
    apiVersion: route.openshift.io/v1
    kind: Route
    metadata:
      name: api-controller-registry-api
      namespace: api-controller
    spec:
      host: api-controller-app.apps.mycluster.example.com
      path: /
      to:
        kind: Service
        name: apicurio-app-service
      port:
        targetPort: http
      tls:
        termination: edge
        insecureEdgeTerminationPolicy: Redirect
      wildcardPolicy: None
    ---
    # Create a route for the Apicurio Registry UI
    apiVersion: route.openshift.io/v1
    kind: Route
    metadata:
      name: api-controller-registry-ui
      namespace: api-controller
    spec:
      host: api-controller-ui.apps.mycluster.example.com
      path: /
      to:
        kind: Service
        name: apicurio-ui-service
      port:
        targetPort: http
      tls:
        termination: edge
        insecureEdgeTerminationPolicy: Redirect
      wildcardPolicy: None
    ---
    # Create a route for the Apicurio Studio UI
    apiVersion: route.openshift.io/v1
    kind: Route
    metadata:
      name: api-controller-studio-ui
      namespace: api-controller
    spec:
      host: api-controller-studio-ui.apps.mycluster.example.com
      path: /
      to:
        kind: Service
        name: apicurio-studio-ui-service
      port:
        targetPort: http
      tls:
        termination: edge
        insecureEdgeTerminationPolicy: Redirect
      wildcardPolicy: None
    Copy to Clipboard Toggle word wrap

Verification

Navigate to the api-controller-studio-ui Route and click the Location URL. The Apicurio Studio console should be displayed.

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat