Operator
Running the Operator
Requirements
- kubectl (>= 1.20)
- Kubernetes distribution such as kind.
Setup
- Setup Kind with ingress controller enabled
```shell
cat <<EOF | kind create cluster --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
extraPortMappings:
- containerPort: 80
hostPort: 80
protocol: TCP
- containerPort: 443
hostPort: 443
protocol: TCP
EOF
- Setup Nginx ingress controller
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.8.0/cert-manager.yaml
- Edit email address in
samples/cert-manager.yaml
and apply configuration using the following command:
kubectl apply -f samples/cert-manager.yaml
kubectl apply -f https://raw.githubusercontent.com/ubogdan/operator/main/deploy/static/provider/kind/deploy.yaml
Setting up Your Development Environment
Requirements
Before you start, install the following tools and packages:
Get sources
git clone https://github.com/ubogdan/operator.git
cd operator
Setup
- Setup Kind with ingress controller enabled
```shell
cat <<EOF | kind create cluster --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
extraPortMappings:
- containerPort: 80
hostPort: 80
protocol: TCP
- containerPort: 443
hostPort: 443
protocol: TCP
EOF
- Setup Nginx ingress controller
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.8.0/cert-manager.yaml
- Edit email address in
samples/cert-manager.yaml
and apply configuration using the following command:
kubectl apply -f samples/cert-manager.yaml
- Run the operator (development mode)
```shell
make install run
- Edit
samples/workloads_v1_container.yaml
and apply configuration using the following command:
kubectl apply -f samples/workloads_v1_container.yaml
Recommended reading