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
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ else
endif

# Default image repo
QUAY_REGISTRY ?= quay.io/opencloudio
QUAY_REGISTRY ?= quay.io/luzarragaben

ifeq ($(BUILD_LOCALLY),0)
ARTIFACTORYA_REGISTRY ?= "docker-na-public.artifactory.swg-devops.com/hyc-cloud-private-integration-docker-local/ibmcom"
Expand Down Expand Up @@ -186,10 +186,10 @@ deploy: manifests ## Deploy controller in the configured Kubernetes cluster in ~

build-dev-image: cloudpak-theme.jar
@echo "Building the $(OPERATOR_IMAGE_NAME) docker dev image for $(LOCAL_ARCH)..."
@docker build -t $(REGISTRY)/$(OPERATOR_IMAGE_NAME)-$(LOCAL_ARCH):dev \
@docker build -t $(QUAY_REGISTRY)/$(OPERATOR_IMAGE_NAME)-$(LOCAL_ARCH):dev-test \
--build-arg VCS_REF=$(VCS_REF) --build-arg RELEASE_VERSION=$(RELEASE_VERSION) \
--build-arg GOARCH=$(LOCAL_ARCH) -f Dockerfile .
@docker push $(REGISTRY)/$(OPERATOR_IMAGE_NAME)-$(LOCAL_ARCH):dev
@docker push $(QUAY_REGISTRY)/$(OPERATOR_IMAGE_NAME)-$(LOCAL_ARCH):$(VERSION)

build-bundle-image: yq
@cp -f bundle/manifests/ibm-common-service-operator.clusterserviceversion.yaml /tmp/ibm-common-service-operator.clusterserviceversion.yaml
Expand Down
180 changes: 10 additions & 170 deletions internal/controller/constant/odlm.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,10 @@ spec:
installPlanApproval: {{ .ApprovalMode }}
name: common-service-postgresql
namespace: "{{ .CPFSNs }}"
packageName: cloud-native-postgresql
packageName: cnpg-ibm
scope: public
operatorConfig: cloud-native-postgresql-operator-config
sourceName: {{ .CatalogSourceName }}
sourceName: ibm-cnpg-postgresql-operator-catalog
sourceNamespace: "{{ .CatalogSourceNs }}"
`
)
Expand Down Expand Up @@ -887,147 +887,13 @@ metadata:
spec:
services:
{{- range .ServiceNames.PostgreSQL }}
- name: {{ . }}
resources:
- apiVersion: batch/v1
kind: Job
name: create-postgres-license-config
namespace: "{{ $.OperatorNs }}"
labels:
operator.ibm.com/opreq-control: 'true'
data:
spec:
activeDeadlineSeconds: 600
backoffLimit: 5
template:
metadata:
annotations:
productID: 068a62892a1e4db39641342e592daa25
productMetric: FREE
productName: IBM Cloud Platform Common Services
spec:
imagePullSecrets:
- name: ibm-entitlement-key
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- amd64
- ppc64le
- s390x
initContainers:
- command:
- bash
- -c
- |
cat << EOF | kubectl apply -f -
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: postgresql-operator-controller-manager-config
data:
EDB_LICENSE_KEY: $(base64 /license_keys/edb/EDB_LICENSE_KEY | tr -d '\n')
EOF
image:
templatingValueFrom:
default:
required: true
configMapKeyRef:
name: cloud-native-postgresql-image-list
key: edb-postgres-license-provider-image
namespace: {{ $.OperatorNs }}
configMapKeyRef:
name: cloud-native-postgresql-operand-images-config
key: edb-postgres-license-provider-image
namespace: {{ $.OperatorNs }}
name: edb-license
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 50Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: false
containers:
- command: ["bash", "-c"]
args:
- |
kubectl delete pods -l app.kubernetes.io/name=cloud-native-postgresql
kubectl annotate secret postgresql-operator-controller-manager-config ibm-license-key-applied="EDB Database with IBM License Key"
image:
templatingValueFrom:
default:
required: true
configMapKeyRef:
name: cloud-native-postgresql-image-list
key: edb-postgres-license-provider-image
namespace: {{ $.OperatorNs }}
configMapKeyRef:
name: cloud-native-postgresql-operand-images-config
key: edb-postgres-license-provider-image
namespace: {{ $.OperatorNs }}
name: restart-edb-pod
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 50Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: false
hostIPC: false
hostNetwork: false
hostPID: false
restartPolicy: OnFailure
securityContext:
runAsNonRoot: true
serviceAccountName: edb-license-sa
- apiVersion: v1
kind: ServiceAccount
name: edb-license-sa
namespace: "{{ $.OperatorNs }}"
- apiVersion: rbac.authorization.k8s.io/v1
kind: Role
name: edb-license-role
namespace: "{{ $.OperatorNs }}"
data:
rules:
- apiGroups: [""]
resources: ["pods", "secrets"]
verbs: ["create", "update", "patch", "get", "list", "delete", "watch"]
- apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
name: edb-license-rolebinding
namespace: "{{ $.OperatorNs }}"
data:
subjects:
- kind: ServiceAccount
name: edb-license-sa
roleRef:
kind: Role
name: edb-license-role
apiGroup: rbac.authorization.k8s.io

{{- end }}
`

//For the above, I essentially deleted all the resources associated with the licensing job from the configmap

// I left all the keycloak stuff alone, it is not used in IM and Zen edb deployments
const (
KeyCloakOpCon = `
apiVersion: operator.ibm.com/v1alpha1
Expand Down Expand Up @@ -2080,7 +1946,7 @@ spec:
force: true
kind: OperandBindInfo
name: common-service-postgresql-bindinfo
- apiVersion: postgresql.k8s.enterprisedb.io/v1
- apiVersion: postgresql.cnpg.ibm.com/v1
kind: Cluster
name: common-service-db
force: true
Expand All @@ -2095,15 +1961,6 @@ spec:
inheritedMetadata:
labels:
foundationservices.cloudpak.ibm.com: cs-db
description:
templatingValueFrom:
objectRef:
apiVersion: v1
kind: Secret
name: postgresql-operator-controller-manager-config
path: .metadata.annotations.ibm-license-key-applied
namespace: {{ .OperatorNs }}
required: true
bootstrap:
initdb:
database: im
Expand All @@ -2124,17 +1981,6 @@ spec:
- amd64
- ppc64le
- s390x
additionalPodAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: k8s.enterprisedb.io/cluster
operator: In
values:
- common-service-db
topologyKey: kubernetes.io/hostname
weight: 50
podAntiAffinityType: preferred
topologyKey: topology.kubernetes.io/zone
topologySpreadConstraints:
Expand All @@ -2158,14 +2004,8 @@ spec:
- common-service-db
imageName:
templatingValueFrom:
default:
required: true
configMapKeyRef:
name: cloud-native-postgresql-image-list
key: ibm-postgresql-16-operand-image
namespace: {{ .OperatorNs }}
configMapKeyRef:
name: cloud-native-postgresql-operand-images-config
name: cnpg-ibm-operand-images-config
key: ibm-postgresql-16-operand-image
namespace: {{ .OperatorNs }}
imagePullSecrets:
Expand Down Expand Up @@ -2549,12 +2389,12 @@ spec:
- stable
name: cloud-native-postgresql-v1.25
namespace: "{{ .CPFSNs }}"
packageName: cloud-native-postgresql
packageName: cnpg-ibm
scope: public
installPlanApproval: {{ .ApprovalMode }}
operatorConfig: cloud-native-postgresql-operator-config
configName: cloud-native-postgresql
sourceName: {{ .CatalogSourceName }}
sourceName: ibm-cnpg-postgresql-operator-catalog
sourceNamespace: "{{ .CatalogSourceNs }}"
- channel: alpha
name: ibm-user-data-services-operator
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/size/large_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const Large = `
memory: 350Mi
- name: common-service-postgresql
resources:
- apiVersion: postgresql.k8s.enterprisedb.io/v1
- apiVersion: postgresql.cnpg.ibm.com/v1
kind: Cluster
name: common-service-db
data:
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/size/medium_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const Medium = `
memory: 350Mi
- name: common-service-postgresql
resources:
- apiVersion: postgresql.k8s.enterprisedb.io/v1
- apiVersion: postgresql.cnpg.ibm.com/v1
kind: Cluster
name: common-service-db
data:
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/size/small_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const Small = `
memory: 350Mi
- name: common-service-postgresql
resources:
- apiVersion: postgresql.k8s.enterprisedb.io/v1
- apiVersion: postgresql.cnpg.ibm.com/v1
kind: Cluster
name: common-service-db
data:
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/size/starterset_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const StarterSet = `
memory: 350Mi
- name: common-service-postgresql
resources:
- apiVersion: postgresql.k8s.enterprisedb.io/v1
- apiVersion: postgresql.cnpg.ibm.com/v1
kind: Cluster
name: common-service-db
data:
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
package version

var (
Version = "4.15.0"
Version = "4.15.99"
)