1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

Fixing release code wrt MANIFESTSUFFIX

This commit is contained in:
Ewout Prangsma 2018-03-20 08:04:22 +01:00
parent d2508a8cf4
commit a21d707a90
No known key found for this signature in database
GPG key ID: 4DBAD380D93D0698
4 changed files with 225 additions and 2 deletions

View file

@ -40,9 +40,14 @@ else
IMAGESUFFIX := :dev
endif
ifeq ($(MANIFESTSUFFIX),-)
# Release setting
MANIFESTSUFFIX :=
else
ifndef MANIFESTSUFFIX
MANIFESTSUFFIX := -dev
endif
endif
MANIFESTPATHDEPLOYMENT := manifests/arango-deployment$(MANIFESTSUFFIX).yaml
MANIFESTPATHSTORAGE := manifests/arango-storage$(MANIFESTSUFFIX).yaml
ifndef DEPLOYMENTNAMESPACE

View file

@ -0,0 +1,103 @@
## deployment/rbac.yaml
## Cluster role granting access to ArangoDeployment resources.
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: arango-deployments
rules:
- apiGroups: ["database.arangodb.com"]
resources: ["arangodeployments"]
verbs: ["*"]
---
## Cluster role granting access to all resources needed by the ArangoDeployment operator.
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: arango-deployment-operator
rules:
- apiGroups: ["database.arangodb.com"]
resources: ["arangodeployments"]
verbs: ["*"]
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["get"]
- apiGroups: [""]
resources: ["pods", "services", "endpoints", "persistentvolumeclaims", "events", "secrets"]
verbs: ["*"]
- apiGroups: ["apps"]
resources: ["deployments"]
verbs: ["*"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list"]
---
## Bind the cluster role granting access to ArangoLocalStorage resources
## to the default service account of the configured namespace.
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
name: arango-deployments
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: arango-deployments
subjects:
- kind: ServiceAccount
name: default
namespace: default
---
## Bind the cluster role granting access to all resources needed by
## the ArangoDeployment operator to the default service account
## the is being used to run the operator deployment.
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: arango-deployment-operator-default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: arango-deployment-operator
subjects:
- kind: ServiceAccount
name: default
namespace: default
---
## deployment/deployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: arango-deployment-operator
namespace: default
spec:
replicas: 1
template:
metadata:
labels:
name: arango-deployment-operator
spec:
containers:
- name: operator
imagePullPolicy: IfNotPresent
image: arangodb/kube-arangodb@sha256:748421ba01fd52d9589cc1830c79b62c3a7af3f4366b9cba0247e09d0a7d6e19
args:
- --operator.deployment
env:
- name: MY_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: MY_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name

View file

@ -0,0 +1,115 @@
## storage/rbac.yaml
## Cluster role granting access to ArangoLocalStorage resources.
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: arango-storages
rules:
- apiGroups: ["storage.arangodb.com"]
resources: ["arangolocalstorages"]
verbs: ["*"]
---
## Cluster role granting access to all resources needed by the ArangoLocalStorage operator.
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: arango-storage-operator
rules:
- apiGroups: ["storage.arangodb.com"]
resources: ["arangolocalstorages"]
verbs: ["*"]
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["get"]
- apiGroups: [""]
resources: ["persistentvolumes", "persistentvolumeclaims", "endpoints", "events", "services"]
verbs: ["*"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get"]
- apiGroups: ["apps"]
resources: ["daemonsets"]
verbs: ["*"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["*"]
---
## Bind the cluster role granting access to ArangoLocalStorage resources
## to the default service account of the configured namespace.
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
name: arango-storages
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: arango-storages
subjects:
- kind: ServiceAccount
name: default
namespace: default
---
## Bind the cluster role granting access to all resources needed by
## the ArangoLocalStorage operator to the default service account
## the is being used to run the operator deployment.
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: arango-storage-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: arango-storage-operator
subjects:
- kind: ServiceAccount
name: arango-storage-operator
namespace: kube-system
---
## storage/deployment.yaml
## Service accounts
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: kube-system
name: arango-storage-operator
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: arango-storage-operator
namespace: kube-system
spec:
replicas: 1
template:
metadata:
labels:
name: arango-storage-operator
spec:
serviceAccountName: arango-storage-operator
containers:
- name: operator
imagePullPolicy: IfNotPresent
image: arangodb/kube-arangodb@sha256:748421ba01fd52d9589cc1830c79b62c3a7af3f4366b9cba0247e09d0a7d6e19
args:
- --operator.storage
env:
- name: MY_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: MY_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name

View file

@ -47,7 +47,7 @@ func init() {
flag.StringVar(&versionFile, "versionfile", "./VERSION", "Path of the VERSION file")
flag.StringVar(&releaseType, "type", "patch", "Type of release to build (major|minor|patch)")
flag.StringVar(&ghRelease, "github-release", ".gobuild/bin/github-release", "Full path of github-release tool")
flag.StringVar(&ghUser, "github-user", "arangodbdb", "Github account name to create release in")
flag.StringVar(&ghUser, "github-user", "arangodb", "Github account name to create release in")
flag.StringVar(&ghRepo, "github-repo", "kube-arangodb", "Github repository name to create release in")
}
@ -60,7 +60,7 @@ func main() {
make("all", map[string]string{
"DOCKERNAMESPACE": "arangodb",
"IMAGETAG": version,
"MANIFESTPATH": "manifests/arango-operator.yaml",
"MANIFESTSUFFIX": "-",
})
make("build-ghrelease", nil)
gitCommitAll(fmt.Sprintf("Updated manifest to %s", version)) // Commit manifest