github.com/verrazzano/verrazzano@v1.7.1/examples/todo-list/todo-list-components.yaml (about)

     1  # Copyright (c) 2020, 2022, Oracle and/or its affiliates.
     2  # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
     3  
     4  apiVersion: core.oam.dev/v1alpha2
     5  kind: Component
     6  metadata:
     7    name: todo-domain
     8  spec:
     9    workload:
    10      apiVersion: oam.verrazzano.io/v1alpha1
    11      kind: VerrazzanoWebLogicWorkload
    12      spec:
    13        template:
    14          apiVersion: weblogic.oracle/v9
    15          metadata:
    16            name: todo-domain
    17          spec:
    18            adminServer:
    19              adminChannelPortForwardingEnabled: true
    20            domainUID: tododomain
    21            domainHome: /u01/domains/tododomain
    22            image: container-registry.oracle.com/middleware/weblogic:12.2.1.4
    23            imagePullSecrets:
    24              - name: tododomain-repo-credentials
    25            domainHomeSourceType: "FromModel"
    26            includeServerOutInPodLog: true
    27            replicas: 1
    28            webLogicCredentialsSecret:
    29              name: tododomain-weblogic-credentials
    30            configuration:
    31              introspectorJobActiveDeadlineSeconds: 900
    32              model:
    33                auxiliaryImages:
    34                  - image: container-registry.oracle.com/verrazzano/example-todo:20211129200415-ae4e89e
    35                configMap: tododomain-jdbc-config
    36                domainType: WLS
    37                runtimeEncryptionSecret: tododomain-runtime-encrypt-secret
    38              secrets:
    39                - tododomain-jdbc-tododb
    40            serverPod:
    41              labels:
    42                app: todo-domain
    43                version: v1
    44              env:
    45                - name: JAVA_OPTIONS
    46                  value: "-Dweblogic.StdoutDebugEnabled=false"
    47                - name: USER_MEM_ARGS
    48                  value: "-Djava.security.egd=file:/dev/./urandom -Xms64m -Xmx256m "
    49                - name: WL_HOME
    50                  value: /u01/oracle/wlserver
    51                - name: MW_HOME
    52                  value: /u01/oracle
    53  ---
    54  apiVersion: core.oam.dev/v1alpha2
    55  kind: Component
    56  metadata:
    57    name: todo-jdbc-configmap
    58  spec:
    59    workload:
    60      apiVersion: v1
    61      kind: ConfigMap
    62      metadata:
    63        name: tododomain-jdbc-config
    64      data:
    65        wdt_jdbc.yaml: |
    66          resources:
    67            JDBCSystemResource:
    68              'ToDo-Datasource':
    69                Target: 'AdminServer'
    70                JdbcResource:
    71                  DatasourceType: GENERIC
    72                  JDBCDataSourceParams:
    73                    GlobalTransactionsProtocol: OnePhaseCommit
    74                    JNDIName: jdbc/ToDoDB
    75                  JDBCConnectionPoolParams:
    76                    ConnectionCreationRetryFrequencySeconds: 5
    77                    ConnectionReserveTimeoutSeconds: 10
    78                    InitialCapacity: 0
    79                    InactiveConnectionTimeoutSeconds: 60
    80                    MaxCapacity: 5
    81                    MinCapacity: 0
    82                    TestConnectionsOnReserve: true
    83                    TestFrequencySeconds: 10
    84                  JDBCDriverParams:
    85                    # for MySQL, the last element in the URL is the database name, and must match the name inside the DB server
    86                    URL: "jdbc:mysql://mysql:3306/tododb"
    87                    PasswordEncrypted: '@@SECRET:tododomain-jdbc-tododb:password@@'
    88                    DriverName: com.mysql.cj.jdbc.Driver
    89                    Properties:
    90                      user:
    91                        Value: '@@SECRET:tododomain-jdbc-tododb:username@@'
    92  ---
    93  apiVersion: core.oam.dev/v1alpha2
    94  kind: Component
    95  metadata:
    96    name: todo-mysql-configmap
    97  spec:
    98    workload:
    99      apiVersion: v1
   100      kind: ConfigMap
   101      metadata:
   102        name: mysql-initdb-config
   103      data:
   104        initdb.sql: |
   105          create table `ToDos` (
   106              `taskId` int not null auto_increment,
   107              `task` varchar(200) not null,
   108              `completed` boolean,
   109              constraint todo_pk primary key (`taskId`)
   110          );
   111  ---
   112  apiVersion: core.oam.dev/v1alpha2
   113  kind: Component
   114  metadata:
   115    name: todo-mysql-service
   116  spec:
   117    workload:
   118      apiVersion: v1
   119      kind: Service
   120      metadata:
   121        name: mysql
   122      spec:
   123        ports:
   124          - port: 3306
   125        selector:
   126          app: todo-mysql
   127        clusterIP: None
   128  ---
   129  apiVersion: core.oam.dev/v1alpha2
   130  kind: Component
   131  metadata:
   132    name: todo-mysql-deployment
   133  spec:
   134    workload:
   135      apiVersion: apps/v1
   136      kind: Deployment
   137      metadata:
   138        name: mysql
   139      spec:
   140        replicas: 1
   141        selector:
   142          matchLabels:
   143            app: todo-mysql
   144        template:
   145          metadata:
   146            labels:
   147              app: todo-mysql
   148              version: v1
   149          spec:
   150            containers:
   151              - env:
   152                  - name: MYSQL_ROOT_PASSWORD
   153                    valueFrom:
   154                      secretKeyRef:
   155                        name: tododomain-jdbc-tododb
   156                        key: password
   157                  - name: MYSQL_USER
   158                    valueFrom:
   159                      secretKeyRef:
   160                        name: tododomain-jdbc-tododb
   161                        key: username
   162                  - name: MYSQL_PASSWORD
   163                    valueFrom:
   164                      secretKeyRef:
   165                        name: tododomain-jdbc-tododb
   166                        key: password
   167                  - name: MYSQL_DATABASE
   168                    value: tododb
   169                image: ghcr.io/verrazzano/mysql:8.0.28
   170                imagePullPolicy: IfNotPresent
   171                name: mysql
   172                ports:
   173                  - containerPort: 3306
   174                    name: mysql
   175                    protocol: TCP
   176                volumeMounts:
   177                  - mountPath: /docker-entrypoint-initdb.d
   178                    name: mysql-initdb
   179            imagePullSecrets:
   180              - name: ocr
   181            volumes:
   182              - configMap:
   183                  defaultMode: 420
   184                  name: mysql-initdb-config
   185                name: mysql-initdb