Skip to content

Commit

Permalink
olm: first shot using olm-bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
jkremser committed Oct 8, 2021
1 parent c8ffe1e commit 7856f8e
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,6 @@ changes
# gh-pages | Jekyll generated files
_site
.jekyll-metadata

# OLM
/olm/bundle
3 changes: 2 additions & 1 deletion chart/k8gb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ apiVersion: v2
name: k8gb
description: A Helm chart for Kubernetes Global Balancer
type: application
version: v0.8.2
version: 0.8.2
appVersion: v0.8.2
icon: https://avatars.githubusercontent.com/u/84017757?s=200&v=4

dependencies:
- name: coredns
Expand Down
14 changes: 14 additions & 0 deletions olm/annotations.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
annotations:
alm-examples: '[{"apiVersion":"k8gb.absa.oss/v1beta1","kind":"Gslb","metadata":{"name":"test-gslb-failover","namespace":"test-gslb"},"spec":{"ingress":{"rules":[{"host":"failover.cloud.example.com","http":{"paths":[{"backend":{"serviceName":"frontend-podinfo","servicePort":"http"},"path":"/"}]}}]},"strategy":{"type":"failover","primaryGeoTag":"eu"}}},{"apiVersion":"k8gb.absa.oss/v1beta1","kind":"Gslb","metadata":{"name":"test-gslb","namespace":"test-gslb"},"spec":{"ingress":{"rules":[{"host":"notfound.cloud.example.com","http":{"paths":[{"backend":{"serviceName":"non-existing-app","servicePort":"http"},"path":"/"}]}},{"host":"unhealthy.cloud.example.com","http":{"paths":[{"backend":{"serviceName":"unhealthy-app","servicePort":"http"},"path":"/"}]}},{"host":"roundrobin.cloud.example.com","http":{"paths":[{"backend":{"serviceName":"frontend-podinfo","servicePort":"http"},"path":"/"}]}}]},"strategy":{"type":"roundRobin","splitBrainThresholdSeconds":300,"dnsTtlSeconds":30}}}]'
capabilities: Seamless Upgrades
categories: Networking
certified: "false"
containerImage: absaoss/k8gb:v0.8.2
createdAt: "2021-09-24 12:00:00"
description: A cloud native Kubernetes Global Balancer
namespace: placeholder
operatorframework.io/suggested-namespace: k8gb
operators.operatorframework.io/builder: operator-sdk-v1.12.0+git
operators.operatorframework.io/project_layout: go.kubebuilder.io/v2
repository: https://github.com/k8gb/k8gb
support: cncf-k8gb-maintainers@lists.cncf.io
124 changes: 124 additions & 0 deletions olm/clusterserviceversion.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
apiVersion: v1alpha1
kind: ClusterServiceVersion
spec:
maintainers:
- email: dinar.valeev@absa.africa
name: Dinar Valeev
- email: jiri.kremser@gmail.com
name: Jiri Kremser
- email: kuritka@gmail.com
name: Michal Kuritka
- email: timofey.ilinykh@absa.africa
name: Timofey Ilinykh
- email: yury.tsarev@absa.africa
name: Yury Tsarev
maturity: alpha
minKubeVersion: 1.17.0
provider:
name: CNCF
url: https://github.com/k8gb-io/k8gb
links:
- name: K8gb
url: https://k8gb.io
description: |
**A cloud native Kubernetes Global Balancer**

A Global Service Load Balancing solution with a focus on having cloud native qualities and work natively in a Kubernetes context.

Key Differentiators:
- Load balancing is based on timeproof DNS protocol which is perfect for global scope and extremely reliable
- No dedicated management cluster and no single point of failure
- Kubernetes native application health checks utilizing status of Liveness and Readiness probes for load balancing decisions
- Configuration with a single Kubernetes CRD of `Gslb` kind

Operator needs to be configured by setting couple of environment variables. This can be done by modifying
the subscription yaml in the web ui or via kubectl. Here is an example of changing the `EDGE_DNS_ZONE`:

```yaml
kind: Subscription
...
spec:
...
config:
env:
- name: CLUSTER_GEO_TAG
value: us
- name: EDGE_DNS_ZONE
value: mycloud.example.com
...
```
For more deployment variables see [helm code](https://github.com/k8gb-io/k8gb/blob/5beb6fc5244ef61c77fcbebb5243908ee77c615f/chart/k8gb/templates/operator.yaml#L53:L70).

For more information see [k8gb.io](https://k8gb.io).
install:
spec:
clusterPermissions:
- rules:
- apiGroups:
- ""
resources:
- endpoints
- services
- pods
- namespaces
verbs:
- list
- watch
- apiGroups:
- discovery.k8s.io
resources:
- endpointslices
verbs:
- list
- watch
- apiGroups:
- ""
resources:
- namespaces
verbs:
- list
- watch
- apiGroups:
- externaldns.k8s.io
resources:
- dnsendpoints
verbs:
- list
- watch
serviceAccountName: coredns
- rules:
- apiGroups:
- ""
resources:
- endpoints
- services
verbs:
- get
- list
- watch
- apiGroups:
- k8gb.absa.oss
resources:
- '*'
- gslbs
verbs:
- '*'
- apiGroups:
- networking.k8s.io
resources:
- ingresses
verbs:
- '*'
- apiGroups:
- externaldns.k8s.io
resources:
- dnsendpoints
verbs:
- '*'
- apiGroups:
- ""
resources:
- namespaces
verbs:
- list
serviceAccountName: k8gb
9 changes: 9 additions & 0 deletions olm/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

DIR="${DIR:-$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )}"

helm -n placeholder template ${DIR}/../chart/k8gb \
--name-template=k8gb \
--set k8gb.securityContext.runAsUser=null \
--set k8gb.log.format=simple \
--set k8gb.log.level=info | olm-bundle --chart-file-path=${DIR}/../chart/k8gb/Chart.yaml --output-dir ${DIR}

0 comments on commit 7856f8e

Please sign in to comment.