Skip to content

Commit

Permalink
Merge pull request #10 from vshn/pkg-provider-kubernetes
Browse files Browse the repository at this point in the history
Add package for provider-kubernetes
  • Loading branch information
ccremer authored Aug 22, 2022
2 parents 88b1863 + 33d8247 commit 1b94514
Show file tree
Hide file tree
Showing 10 changed files with 184 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/modules/ROOT/pages/references/provider-kubernetes.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
= pkg.appcat.provider.kubernetes

The parent key for all of the following parameters is `pkg.appcat.provider.kubernetes`.

== `images:provider-kubernetes`

[horizontal]
type:: dict
default:: see `packages/provider/kubernetes.yml`

The package image repository for https://github.com/crossplane-contrib/provider-kubernetes[provider-kubernetes].
1 change: 1 addition & 0 deletions docs/modules/ROOT/partials/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.Technical reference
* xref:references/component-parameters.adoc[Component Parameters]
* xref:references/provider-cloudscale.adoc[Parameters For provider.cloudscale]
* xref:references/provider-kubernetes.adoc[Parameters For provider.kubernetes]
* xref:references/composite-objectstorage.adoc[Parameters For composite.objectstorage]
* Compositions
Expand Down
76 changes: 76 additions & 0 deletions packages/provider/kubernetes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
classes:
- .common

parameters:

pkg.appcat.provider.kubernetes:
images:
provider-kubernetes:
registry: docker.io
repository: crossplane/provider-kubernetes
tag: v0.4.0

crossplane:
providers:
kubernetes:
package: ${pkg.appcat.provider.kubernetes:images:provider-kubernetes:registry}/${pkg.appcat.provider.kubernetes:images:provider-kubernetes:repository}:${pkg.appcat.provider.kubernetes:images:provider-kubernetes:tag}

providerConfigs:
kubernetes:
apiVersion: kubernetes.crossplane.io/v1alpha1
spec:
credentials:
source: InjectedIdentity

controllerConfigs:
provider-kubernetes:
spec:
# We need to set a different SA name than the generated one, to allow RBAC permissions for reading namespaces.
serviceAccountName: provider-kubernetes

serviceAccounts:
provider-kubernetes: {}

clusterRoles:
"crossplane:provider:provider-kubernetes:system:custom":
rules:
- verbs:
- get
- list
- watch
- update
- patch
- create
apiGroups:
- kubernetes.crossplane.io
resources:
- '*'
- verbs:
- '*'
apiGroups:
- ''
- coordination.k8s.io
resources:
- secrets
- configmaps
- events
- leases
- verbs:
- 'get'
- 'list'
- 'watch'
apiGroups:
- ''
resources:
- namespaces

clusterRoleBindings:
"crossplane:provider:provider-kubernetes:system:custom":
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: crossplane:provider:provider-kubernetes:system:custom
subjects:
- kind: ServiceAccount
name: provider-kubernetes
namespace: ${crossplane:namespace}
2 changes: 2 additions & 0 deletions packages/tests/composition-objectstorage-cloudscale.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
classes:
- ..composition.objectstorage.cloudscale
# composition requires provider-kubernetes as dependency
- ..provider.kubernetes

parameters:
crossplane:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/sync-wave: '10'
labels:
name: kubernetes
name: kubernetes
spec:
package: docker.io/crossplane/provider-kubernetes:v0.4.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: pkg.crossplane.io/v1alpha1
kind: ControllerConfig
metadata:
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/sync-wave: '10'
labels:
name: provider-kubernetes
name: provider-kubernetes
spec:
serviceAccountName: provider-kubernetes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
annotations: {}
labels:
name: provider-kubernetes
name: provider-kubernetes
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations: {}
labels:
name: crossplane-provider-provider-kubernetes-system-custom
name: crossplane:provider:provider-kubernetes:system:custom
rules:
- apiGroups:
- kubernetes.crossplane.io
resources:
- '*'
verbs:
- get
- list
- watch
- update
- patch
- create
- apiGroups:
- ''
- coordination.k8s.io
resources:
- secrets
- configmaps
- events
- leases
verbs:
- '*'
- apiGroups:
- ''
resources:
- namespaces
verbs:
- get
- list
- watch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations: {}
labels:
name: crossplane-provider-provider-kubernetes-system-custom
name: crossplane:provider:provider-kubernetes:system:custom
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: crossplane:provider:provider-kubernetes:system:custom
subjects:
- kind: ServiceAccount
name: provider-kubernetes
namespace: syn-crossplane
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,16 @@ spec:
name: cloudscale-api-token
namespace: syn-crossplane
source: InjectedIdentity
---
apiVersion: kubernetes.crossplane.io/v1alpha1
kind: ProviderConfig
metadata:
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/sync-wave: '10'
labels:
name: kubernetes
name: kubernetes
spec:
credentials:
source: InjectedIdentity

0 comments on commit 1b94514

Please sign in to comment.