Kubernetes operator for the Azure DevOps pipe-line agents

adoagent-operator

Kubernetes operator for the Azure DevOps pipe-line agents

init.sh

#!/bin/bash

# docker and github repo username
export USERNAME='bartvanbenthem'
# image and bundle version
export VERSION=1.0.1
# operator repo and name
export OPERATOR_NAME='adoagent-operator'
export OPERATOR_GROUP='ado'
export OPERATOR_KIND='Agent'
export OPERATOR_DOMAIN='gofound.nl'

cd $OPERATOR_NAME
# scaffold operator
operator-sdk init --domain $OPERATOR_DOMAIN --repo github.com/$USERNAME/$OPERATOR_NAME --skip-go-version-check
operator-sdk create api --group $OPERATOR_GROUP --version v1alpha1 --kind $OPERATOR_KIND --resource --controller

# always run make after changing *_types.go and *_controller.go
make generate
make manifests

#######################################################
# Build the operator
make manifests
make docker-build docker-push IMG=docker.io/$USERNAME/$OPERATOR_NAME:v$VERSION

#######################################################
# test and deploy the operator
make deploy IMG=docker.io/$USERNAME/$OPERATOR_NAME:v$VERSION
kubectl create ns test
kubectl -n test apply -f config/samples/ado_v1alpha1_agent.yaml
kubectl -n test get agent agent-sample
kubectl -n test get pods
# cleanup deployment
make undeploy
kubectl delete ns test


#######################################################
#######################################################
# Operator Lifecycle Manager - create and install bundle
operator-sdk olm install
operator-sdk olm status

# set env vars for creating the bundle
export IMG=docker.io/$USERNAME/$OPERATOR_NAME:v$VERSION
export BUNDLE_IMG=docker.io/$USERNAME/$OPERATOR_NAME-bundle:v$VERSION

# make the olm bundle
make bundle
# build and push the bundle image:
make bundle-build bundle-push
# verify bundle
operator-sdk bundle validate docker.io/$USERNAME/$OPERATOR_NAME-bundle:v$VERSION

# installing the bundle
operator-sdk run bundle docker.io/$USERNAME/$OPERATOR_NAME-bundle:v$VERSION --timeout 15m

# apply custom resource example
kubectl create ns test
kubectl -n test apply -f config/samples/ado_v1alpha1_agent.yaml
kubectl -n test get agent agent-sample

#######################################################
#######################################################
# Cleaning up your cluster
k -n test get operators
operator-sdk cleanup adoagent-operator
# If your bundle is in a bad state, you can clean up all the OLM and OLM-dependent 
# resources by running the following command:
operator-sdk olm uninstall


#######################################################
# Redeploying from scratch
operator-sdk olm install

operator-sdk run bundle docker.io/$USERNAME/$OPERATOR_NAME-bundle:v1.0.0
kubectl apply -f config/sample/ado_v1alpha1_agent.yaml

Agent Sample

apiVersion: ado.gofound.nl/v1alpha1
kind: Agent
metadata:
  name: agent-sample
spec:
  size: 2
  configStringData: {}
  secretData: {}
  securityPolicy:
    podSelector:
      matchLabels:
        agent_cr: agent-sample
    policyTypes:
    - Egress
    egress:
    - to:
      - ipBlock:
          cidr: 10.0.0.0/24
      ports:
      - protocol: TCP
        port: 80
Similar Resources

Pulumi-k8s-operator-example - OpenGitOps Compliant Pulumi Kubernetes Operator Example

Pulumi GitOps Example OpenGitOps Compliant Pulumi Kubernetes Operator Example Pr

May 6, 2022

Kubernetes Operator Samples using Go, the Operator SDK and OLM

Kubernetes Operator Samples using Go, the Operator SDK and OLM

Kubernetes Operator Patterns and Best Practises This project contains Kubernetes operator samples that demonstrate best practices how to develop opera

Nov 24, 2022

traefik-block-ua is a traefik plugin to whitelist requests based on the user agents

traefik-block-ua is a traefik plugin to whitelist requests based on the user agents

Nov 20, 2021

Test Operator using operator-sdk 1.15

test-operator Test Operator using operator-sdk 1.15 operator-sdk init --domain rbt.com --repo github.com/ravitri/test-operator Writing kustomize manif

Dec 28, 2021

a k8s operator 、operator-sdk

helloworld-operator a k8s operator 、operator-sdk Operator 参考 https://jicki.cn/kubernetes-operator/ https://learnku.com/articles/60683 https://opensour

Jan 27, 2022

Operator Permissions Advisor is a CLI tool that will take a catalog image and statically parse it to determine what permissions an Operator will request of OLM during an install

Operator Permissions Advisor is a CLI tool that will take a catalog image and statically parse it to determine what permissions an Operator will request of OLM during an install. The permissions are aggregated from the following sources:

Apr 22, 2022

DevOps With Kubernetes exercise

todo-project [https://github.com/pasiol/todo-project/tree/1.05] Exercise 1.06 [email protected]:~$ k3d cluster delete INFO[0000] Deleting cluster 'k3s-defaul

Dec 8, 2021

Git-based DevOps PaaS: Project, Pipeline, Kubernetes, ServiceMesh, MutilCloud

gitctl 一体化 DevOps 平台 从代码到应用的一体化编排,应用全生命周期管理,多云托管。 gitctl 会有哪些功能? git 代码托管 projec

Oct 24, 2022

The OCI Service Operator for Kubernetes (OSOK) makes it easy to connect and manage OCI services from a cloud native application running in a Kubernetes environment.

OCI Service Operator for Kubernetes Introduction The OCI Service Operator for Kubernetes (OSOK) makes it easy to create, manage, and connect to Oracle

Sep 27, 2022
Basic Kubernetes operator that have multiple versions in CRD. This operator can be used to experiment and understand Operator/CRD behaviors.

add-operator Basic Kubernetes operator that have multiple versions in CRD. This operator can be used to experiment and understand Operator/CRD behavio

Dec 15, 2021
An operator which complements grafana-operator for custom features which are not feasible to be merged into core operator

Grafana Complementary Operator A grafana which complements grafana-operator for custom features which are not feasible to be merged into core operator

Aug 16, 2022
A Kubernetes Operator, that helps DevOps team accelerate their journey into the cloud and K8s.
A Kubernetes Operator, that helps DevOps team accelerate their journey into the cloud and K8s.

A Kubernetes Operator, that helps DevOps team accelerate their journey into the cloud and K8s. OAM operator scaffolds all of the code required to create resources across various cloud provides, which includes both K8s and Non-K8s resources

Nov 30, 2021
The Oracle Database Operator for Kubernetes (a.k.a. OraOperator) helps developers, DBAs, DevOps and GitOps teams reduce the time and complexity of deploying and managing Oracle Databases

The Oracle Database Operator for Kubernetes (a.k.a. OraOperator) helps developers, DBAs, DevOps and GitOps teams reduce the time and complexity of deploying and managing Oracle Databases. It eliminates the dependency on a human operator or administrator for the majority of database operations.

Dec 14, 2022
Terraform Provider for Azure (Resource Manager)Terraform Provider for Azure (Resource Manager)
Terraform Provider for Azure (Resource Manager)Terraform Provider for Azure (Resource Manager)

Terraform Provider for Azure (Resource Manager) Version 2.x of the AzureRM Provider requires Terraform 0.12.x and later, but 1.0 is recommended. Terra

Oct 16, 2021
azqlite is a lightweight wrapper around Azure's SDK to interact with the Azure Storage Queue service in a simpler and more idiomatic way.

azqlite azqlite is a lightweight wrapper around github.com/Azure/azure-storage-queue-go to interact with the Azure Storage Queue service in a simpler

Mar 12, 2022
The Elastalert Operator is an implementation of a Kubernetes Operator, to easily integrate elastalert with gitops.

Elastalert Operator for Kubernetes The Elastalert Operator is an implementation of a Kubernetes Operator. Getting started Firstly, learn How to use el

Jun 28, 2022
Minecraft-operator - A Kubernetes operator for Minecraft Java Edition servers

Minecraft Operator A Kubernetes operator for dedicated servers of the video game

Dec 15, 2022
K8s-network-config-operator - Kubernetes network config operator to push network config to switches

Kubernetes Network operator Will add more to the readme later :D Operations The

May 16, 2022