Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/examples/db2/quickstart/standalone.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: kubedb.com/v1alpha2
kind: DB2
metadata:
name: db2
namespace: demo
spec:
version: 11.5.8.0
storageType: Durable
deletionPolicy: Delete
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
110 changes: 110 additions & 0 deletions docs/guides/db2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
---
title: DB2
menu:
docs_{{ .version }}:
identifier: db2-readme
name: DB2
parent: db2-guides
weight: 10
menu_name: docs_{{ .version }}
section_menu_id: guides
url: /docs/{{ .version }}/guides/db2/
aliases:
- /docs/{{ .version }}/guides/db2/README/
---

> New to KubeDB? Please start [here](/docs/README.md).

# Overview

KubeDB supports IBM DB2 using the `DB2` Custom Resource Definition (CRD). You can declare the desired DB2 configuration, and KubeDB provisions and manages the required Kubernetes resources.

KubeDB simplifies deploying and managing DB2 on Kubernetes with a declarative API. It automates common operational tasks such as:

- Creating and provisioning standalone DB2 instances
- Managing persistent storage and data recovery
- Handling authentication and authorization
- Customizing pod templates and service configurations
- Monitoring database health

## Supported DB2 Features

| Features | Availability |
|--------------------------------|:------------:|
| Standalone DB2 deployment | ✓ |
| Persistent volume | ✓ |
| Authentication secret | ✓ |
| Pod and service customization | ✓ |
| Health checker | ✓ |
| Custom RBAC | ✓ |
| Private registry | ✓ |


## Example DB2 Manifest

Here's a simple example of a DB2 deployment:

```yaml
apiVersion: kubedb.com/v1alpha2
kind: DB2
metadata:
name: db2
namespace: demo
spec:
version: 11.5.8.0
storageType: Durable
storage:
storageClassName: standard
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
deletionPolicy: Delete
healthChecker:
periodSeconds: 10
timeoutSeconds: 10
failureThreshold: 3
```

For a complete list of available configuration options, see the [DB2 CRD Documentation](/docs/guides/db2/concepts/db2.md).

## User Guide

Learn about DB2 features and how to use them:

### Quickstart
- [Quickstart](/docs/guides/db2/quickstart/quickstart.md) - Deploy your first DB2 instance with KubeDB operator

### Concepts
- [DB2 CRD](/docs/guides/db2/concepts/db2.md) - Understand the DB2 Custom Resource Definition and all available configuration options
- [DB2Version CRD](/docs/guides/db2/concepts/catalog.md) - Learn about specifying DB2 versions and docker images

### Setup & Configuration
- [Custom RBAC](/docs/guides/db2/custom-rbac/using-custom-rbac.md) - Setup custom ServiceAccount, Role, and RoleBinding for DB2 instances
- [Using Private Registry](/docs/guides/db2/private-registry/using-private-registry.md) - Deploy DB2 using images from a private docker registry



## Architecture

KubeDB uses a PetSet (similar to StatefulSet) to manage DB2 instances, ensuring stable network identities and persistent storage. Each DB2 instance:

- Runs as a single pod in a PetSet
- Uses a PersistentVolume for data storage
- Comes with automated health checking via a coordinator container

## What's Next

- **Want to learn more?** Check out the [DB2 Concepts](/docs/guides/db2/concepts/db2.md) page and explore the [Configuration](/docs/guides/db2/concepts/db2.md#spec-podtemplate) options.
- **Want to deploy DB2?** Follow the [Quickstart](/docs/guides/db2/quickstart/quickstart.md) guide.
- **Want to set up custom RBAC?** See the [Custom RBAC](/docs/guides/db2/custom-rbac/using-custom-rbac.md) guide.
- **Want to use a private registry?** Follow the [Private Registry](/docs/guides/db2/private-registry/using-private-registry.md) guide.

## Support

To speak with us, use the [Slack channel](http://slack.appscode.com) in the `#kubedb` room.

## Contributing

Want to help improve KubeDB? Please start [here](/docs/CONTRIBUTING.md).
10 changes: 10 additions & 0 deletions docs/guides/db2/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: DB2
menu:
docs_{{ .version }}:
identifier: db2-guides
name: DB2
parent: guides
weight: 12
menu_name: docs_{{ .version }}
---
10 changes: 10 additions & 0 deletions docs/guides/db2/concepts/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: DB2 Concepts
menu:
docs_{{ .version }}:
identifier: db2-concepts-db2
name: Concepts
parent: db2-guides
weight: 15
menu_name: docs_{{ .version }}
---
83 changes: 83 additions & 0 deletions docs/guides/db2/concepts/catalog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
title: DB2Version CRD
menu:
docs_{{ .version }}:
identifier: db2-catalog-concepts
name: DB2Version
parent: db2-concepts-db2
weight: 15
menu_name: docs_{{ .version }}
section_menu_id: guides
---

> New to KubeDB? Please start [here](/docs/README.md).

# DB2Version

## What is DB2Version

`DB2Version` is a Kubernetes `Custom Resource Definitions` (CRD). It provides a declarative configuration to specify the docker images to be used for [DB2](https://www.ibm.com/products/db2) database deployed with KubeDB in a Kubernetes native way.

When you install KubeDB, a `DB2Version` custom resource will be created automatically for every supported DB2 versions. You have to specify the name of `DB2Version` CR in `spec.version` field of [DB2](/docs/guides/db2/concepts/db2.md) crd. Then, KubeDB will use the docker images specified in the `DB2Version` CR to create your expected database.

Using a separate CRD for specifying respective docker images, and pod security policy names allow us to modify the images, and policies independent of KubeDB operator. This will also allow the users to use a custom image for the database.

## DB2Version Specification

```yaml
apiVersion: catalog.kubedb.com/v1alpha1
kind: DB2Version
metadata:
name: "11.5.8.0"
spec:
version: "11.5.8.0"
coordinator:
image: "ghcr.io/kubedb/db2-coordinator:v0.5.0-ubi"
db:
image: "kubedb/db2:11.5.8.0"
deprecated: false
```

### metadata.name

`metadata.name` is a required field that specifies the name of the `DB2Version` CR. You have to specify this name in `spec.version` field of [DB2](/docs/guides/db2/concepts/db2.md) CR.

We follow this convention for naming DB2Version CR:

- Name format: `{Original DB2 version}-{modification tag}`

We use official IBM DB2 release images to build docker images for supporting DB2 versions and re-tag the image with v1, v2 etc. modification tag when there's any. An image with higher modification tag will have more features than the images with lower modification tag. Hence, it is recommended to use DB2 CR with the highest modification tag to enjoy the latest features.

### spec.version

`spec.version` is a required field that specifies the original version of DB2 database that has been used to build the docker image specified in `spec.db.image` field.

### spec.deprecated

`spec.deprecated` is an optional field that specifies whether the docker images specified here is supported by the current KubeDB operator.

The default value of this field is `false`. If `spec.deprecated` is set to `true`, KubeDB operator will skip processing this CRD object and will add a event to the CRD object specifying that the DB version is deprecated.

### spec.db.image

`spec.db.image` is a required field that specifies the docker image which will be used to create PetSet by KubeDB operator to create expected DB2 database.

### spec.coordinator.image

`spec.coordinator.image` is a required field that specifies the docker image for the DB2 coordinator container. The coordinator image is used by KubeDB to perform health checks on the DB2 database instance.

The coordinator container runs alongside the main DB2 database container and is responsible for:

- Monitoring the health status of the DB2 database
- Performing periodic health checks to ensure the database is running properly
- Reporting the database status to KubeDB operator
- Handling graceful shutdowns and recovery procedures

This separate coordinator image allows KubeDB to reliably detect database failures and take appropriate actions such as pod restarts or alerts.



## Next Steps

- Read the [DB2 CRD concept](/docs/guides/db2/concepts/db2.md).
- Run the [DB2 quickstart](/docs/guides/db2/quickstart/quickstart.md).
Loading
Loading