Skip to content

Renaming changes #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 6, 2020
Merged
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/support-question.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ assignees: ''

## Type of question

Are you asking about best practices, how to configure the Application Stacks Operator, or about general context and help around the operator?
Are you asking about best practices, how to configure the Runtime Component Operator, or about general context and help around the operator?

## Question

Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: go
go:
- 1.13.x

go_import_path: github.com/application-stacks/operator
go_import_path: github.com/application-stacks/runtime-component-operator
env:
- GO111MODULE=on

Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
This file includes chronologically ordered list of notable changes visible to end users for each version of the Application Stacks Operator. Keep a summary of the change and link to the pull request.
This file includes chronologically ordered list of notable changes visible to end users for each version of the Runtime Component Operator. Keep a summary of the change and link to the pull request.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
Expand All @@ -11,4 +11,4 @@ All notable changes to this project will be documented in this file.
## [Unreleased]

- Changed the default labels that are created by the operator, to better
accommodate components that are being deployed onto OpenShift. ([#21](https://github.com/application-stacks/operator/pull/21))
accommodate components that are being deployed onto OpenShift. ([#21](https://github.com/application-stacks/runtime-component-operator/pull/21))
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ build: ## Compile the operator
go install ./cmd/manager

unit-test: ## Run unit tests
go test -v -mod=vendor -tags=unit github.com/application-stacks/operator/pkg/...
go test -v -mod=vendor -tags=unit github.com/application-stacks/runtime-component-operator/pkg/...

test-e2e: setup ## Run end-to-end tests
./scripts/e2e.sh

test-e2e-locally: setup
kubectl apply -f scripts/servicemonitor.crd.yaml
operator-sdk test local github.com/application-stacks/operator/test/e2e --verbose --debug --up-local --namespace ${WATCH_NAMESPACE}
operator-sdk test local github.com/application-stacks/runtime-component-operator/test/e2e --verbose --debug --up-local --namespace ${WATCH_NAMESPACE}

generate: setup ## Invoke `k8s` and `openapi` generators
operator-sdk generate k8s
Expand Down Expand Up @@ -83,14 +83,14 @@ install-crd: ## Installs operator CRD in the daily directory
kubectl apply -f deploy/releases/daily/app-stacks-crd.yaml

install-rbac: ## Installs RBAC objects required for the operator to in a cluster-wide manner
sed -i.bak -e "s/APPLICATION_STACKS_OPERATOR_NAMESPACE/${OPERATOR_NAMESPACE}/" deploy/releases/daily/app-stacks-cluster-rbac.yaml
sed -i.bak -e "s/RUNTIME_COMPONENT_OPERATOR_NAMESPACE/${OPERATOR_NAMESPACE}/" deploy/releases/daily/app-stacks-cluster-rbac.yaml
kubectl apply -f deploy/releases/daily/app-stacks-cluster-rbac.yaml

install-operator: ## Installs operator in the ${OPERATOR_NAMESPACE} namespace and watches ${WATCH_NAMESPACE} namespace. ${WATCH_NAMESPACE} defaults to `default`. ${OPERATOR_NAMESPACE} defaults to ${WATCH_NAMESPACE}
ifneq "${OPERATOR_IMAGE}:${OPERATOR_IMAGE_TAG}" "application-stacks/operator:daily"
sed -i.bak -e 's!image: application-stacks/operator:daily!image: ${OPERATOR_IMAGE}:${OPERATOR_IMAGE_TAG}!' deploy/releases/daily/app-stacks-operator.yaml
ifneq "${OPERATOR_IMAGE}:${OPERATOR_IMAGE_TAG}" "applicationstacks/operator:daily"
sed -i.bak -e 's!image: applicationstacks/operator:daily!image: ${OPERATOR_IMAGE}:${OPERATOR_IMAGE_TAG}!' deploy/releases/daily/app-stacks-operator.yaml
endif
sed -i.bak -e "s/APPLICATION_STACKS_WATCH_NAMESPACE/${WATCH_NAMESPACE}/" deploy/releases/daily/app-stacks-operator.yaml
sed -i.bak -e "s/RUNTIME_COMPONENT_WATCH_NAMESPACE/${WATCH_NAMESPACE}/" deploy/releases/daily/app-stacks-operator.yaml
kubectl apply -n ${OPERATOR_NAMESPACE} -f deploy/releases/daily/app-stacks-operator.yaml

install-all: install-crd install-rbac install-operator
Expand Down
14 changes: 7 additions & 7 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
FROM registry.access.redhat.com/ubi7/ubi-minimal:latest

LABEL vendor="Application Stacks" \
name="Application Stacks Operator" \
LABEL vendor="Runtime Component Community" \
name="Runtime Component Operator" \
version="0.4.0" \
summary="Image for Application Stacks Operator" \
description="This image contains the controller for Application Stacks Operator. See https://github.com/application-stacks/operator"
summary="Image for Runtime Component Operator" \
description="This image contains the controller for Runtime Component Operator. See https://github.com/application-stacks/runtime-component-operator"

ENV OPERATOR=/usr/local/bin/application-stacks-operator \
ENV OPERATOR=/usr/local/bin/runtime-component-operator \
USER_UID=1001 \
USER_NAME=application-stacks-operator
USER_NAME=runtime-component-operator

# install operator binary
COPY build/_output/bin/operator ${OPERATOR}
COPY build/_output/bin/runtime-component-operator ${OPERATOR}
COPY build/bin /usr/local/bin
COPY LICENSE /licenses/

Expand Down
2 changes: 1 addition & 1 deletion build/bin/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

if ! whoami &>/dev/null; then
if [ -w /etc/passwd ]; then
echo "${USER_NAME:-application-stacks-operator}:x:$(id -u):$(id -g):${USER_NAME:-application-stacks-operator} user:${HOME}:/sbin/nologin" >> /etc/passwd
echo "${USER_NAME:-runtime-component-operator}:x:$(id -u):$(id -g):${USER_NAME:-runtime-component-operator} user:${HOME}:/sbin/nologin" >> /etc/passwd
fi
fi

Expand Down
8 changes: 4 additions & 4 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
_ "k8s.io/client-go/plugin/pkg/client/auth"

"github.com/application-stacks/operator/pkg/apis"
"github.com/application-stacks/operator/pkg/controller"
"github.com/application-stacks/operator/version"
"github.com/application-stacks/runtime-component-operator/pkg/apis"
"github.com/application-stacks/runtime-component-operator/pkg/controller"
"github.com/application-stacks/runtime-component-operator/version"

"github.com/operator-framework/operator-sdk/pkg/k8sutil"
"github.com/operator-framework/operator-sdk/pkg/leader"
Expand Down Expand Up @@ -83,7 +83,7 @@ func main() {
ctx := context.TODO()

// Become the leader before proceeding
err = leader.Become(ctx, "application-stacks-operator-lock")
err = leader.Become(ctx, "runtime-component-operator-lock")
if err != nil {
log.Error(err, "")
os.Exit(1)
Expand Down
4 changes: 2 additions & 2 deletions deploy/cluster_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: application-stacks-operator
name: runtime-component-operator
rules:
- apiGroups:
- ""
Expand Down Expand Up @@ -42,7 +42,7 @@ rules:
- apiGroups:
- apps
resourceNames:
- application-stacks-operator
- runtime-component-operator
resources:
- deployments/finalizers
verbs:
Expand Down
8 changes: 4 additions & 4 deletions deploy/cluster_role_binding.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: application-stacks-operator
name: runtime-component-operator
subjects:
- kind: ServiceAccount
name: application-stacks-operator
namespace: APPLICATION_STACKS_OPERATOR_NAMESPACE
name: runtime-component-operator
namespace: RUNTIME_COMPONENT_OPERATOR_NAMESPACE
roleRef:
kind: ClusterRole
name: application-stacks-operator
name: runtime-component-operator
apiGroup: rbac.authorization.k8s.io
4 changes: 2 additions & 2 deletions deploy/crds/app.stacks_runtimecomponents_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ spec:
listKind: RuntimeComponentList
plural: runtimecomponents
shortNames:
- app
- apps
- comp
- comps
singular: runtimecomponent
scope: Namespaced
subresources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ spec:
verbs:
- update
- apiGroups:
- appsody.dev
- app.stacks
resources:
- '*'
verbs:
Expand All @@ -261,21 +261,21 @@ spec:
- '*'
serviceAccountName: runtime-component-operator
deployments:
- name: appsody-operator
- name: runtime-component-operator
spec:
replicas: 1
selector:
matchLabels:
name: appsody-operator
name: runtime-component-operator
strategy: {}
template:
metadata:
labels:
name: appsody-operator
name: runtime-component-operator
spec:
containers:
- command:
- appsody-operator
- runtime-component-operator
env:
- name: WATCH_NAMESPACE
valueFrom:
Expand All @@ -289,9 +289,9 @@ spec:
value: runtime-component-operator
image: applicationstacks/operator:0.4.0
imagePullPolicy: Always
name: appsody-operator
name: runtime-component-operator
resources: {}
serviceAccountName: appsody-operator
serviceAccountName: runtime-component-operator
strategy: deployment
installModes:
- supported: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ spec:
verbs:
- update
- apiGroups:
- appsody.dev
- app.stacks
resources:
- '*'
verbs:
Expand All @@ -261,21 +261,21 @@ spec:
- '*'
serviceAccountName: runtime-component-operator
deployments:
- name: appsody-operator
- name: runtime-component-operator
spec:
replicas: 1
selector:
matchLabels:
name: appsody-operator
name: runtime-component-operator
strategy: {}
template:
metadata:
labels:
name: appsody-operator
name: runtime-component-operator
spec:
containers:
- command:
- appsody-operator
- runtime-component-operator
env:
- name: WATCH_NAMESPACE
valueFrom:
Expand All @@ -289,9 +289,9 @@ spec:
value: runtime-component-operator
image: applicationstacks/operator:0.4.0
imagePullPolicy: Always
name: appsody-operator
name: runtime-component-operator
resources: {}
serviceAccountName: appsody-operator
serviceAccountName: runtime-component-operator
strategy: deployment
installModes:
- supported: true
Expand Down
16 changes: 8 additions & 8 deletions deploy/operator.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: application-stacks-operator
name: runtime-component-operator
spec:
replicas: 1
selector:
matchLabels:
name: application-stacks-operator
name: runtime-component-operator
template:
metadata:
labels:
name: application-stacks-operator
name: runtime-component-operator
spec:
serviceAccountName: application-stacks-operator
serviceAccountName: runtime-component-operator
containers:
- name: application-stacks-operator
image: application-stacks/operator:daily
- name: runtime-component-operator
image: applicationstacks/operator:daily
command:
- application-stacks-operator
- runtime-component-operator
imagePullPolicy: Always
env:
- name: WATCH_NAMESPACE
Expand All @@ -29,4 +29,4 @@ spec:
fieldRef:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: "application-stacks-operator"
value: "runtime-component-operator"
4 changes: 2 additions & 2 deletions deploy/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
creationTimestamp: null
name: application-stacks-operator
name: runtime-component-operator
rules:
- apiGroups:
- ""
Expand Down Expand Up @@ -41,7 +41,7 @@ rules:
- apiGroups:
- apps
resourceNames:
- application-stacks-operator
- runtime-component-operator
resources:
- deployments/finalizers
verbs:
Expand Down
6 changes: 3 additions & 3 deletions deploy/role_binding.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: application-stacks-operator
name: runtime-component-operator
subjects:
- kind: ServiceAccount
name: application-stacks-operator
name: runtime-component-operator
roleRef:
kind: Role
name: application-stacks-operator
name: runtime-component-operator
apiGroup: rbac.authorization.k8s.io
2 changes: 1 addition & 1 deletion deploy/service_account.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: application-stacks-operator
name: runtime-component-operator
8 changes: 4 additions & 4 deletions doc/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ Here are some basic troubleshooting methods to check if the operator is running
* Run the following and check if the output is similar to the following:

```console
$ oc get pods -l name=application-stacks-operator
$ oc get pods -l name=runtime-component-operator

NAME READY STATUS RESTARTS AGE
application-stacks-operator-584d6bd86d-fzq2n 1/1 Running 0 33m
runtime-component-operator-584d6bd86d-fzq2n 1/1 Running 0 33m
```

* Check the operators events:

```console
$ oc describe pod application-stacks-operator-584d6bd86d-fzq2n
$ oc describe pod runtime-component-operator-584d6bd86d-fzq2n
```

* Check the operator logs:

```console
$ oc logs application-stacks-operator-584d6bd86d-fzq2n
$ oc logs runtime-component-operator-584d6bd86d-fzq2n
```

If the operator is running fine, check the status of the `RuntimeComponent` Custom Resource (CR) instance:
Expand Down
8 changes: 4 additions & 4 deletions doc/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ Each `RuntimeComponent` CR must at least specify the `applicationImage` paramete
| `resourceConstraints.requests.memory` | The minimum memory in bytes. Specify integers with one of these suffixes: E, P, T, G, M, K, or power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki.|
| `resourceConstraints.limits.cpu` | The upper limit of CPU core. Specify integers, fractions (e.g. 0.5), or millicores values(e.g. 100m, where 100m is equivalent to .1 core). |
| `resourceConstraints.limits.memory` | The memory upper limit in bytes. Specify integers with suffixes: E, P, T, G, M, K, or power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki.|
| `env` | An array of environment variables following the format of `{name, value}`, where value is a simple string. It may also follow the format of `{name, valueFrom}`, where valueFrom refers to a value in a `ConfigMap` or `Secret` resource. See [Environment variables](https://github.com/application-stacks/operator/blob/master/doc/user-guide.md#environment-variables) for more info.|
| `envFrom` | An array of references to `ConfigMap` or `Secret` resources containing environment variables. Keys from `ConfigMap` or `Secret` resources become environment variable names in your container. See [Environment variables](https://github.com/application-stacks/operator/blob/master/doc/user-guide.md#environment-variables) for more info.|
| `env` | An array of environment variables following the format of `{name, value}`, where value is a simple string. It may also follow the format of `{name, valueFrom}`, where valueFrom refers to a value in a `ConfigMap` or `Secret` resource. See [Environment variables](https://github.com/application-stacks/runtime-component-operator/blob/master/doc/user-guide.md#environment-variables) for more info.|
| `envFrom` | An array of references to `ConfigMap` or `Secret` resources containing environment variables. Keys from `ConfigMap` or `Secret` resources become environment variable names in your container. See [Environment variables](https://github.com/application-stacks/runtime-component-operator/blob/master/doc/user-guide.md#environment-variables) for more info.|
| `readinessProbe` | A YAML object configuring the [Kubernetes readiness probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#define-readiness-probes) that controls when the pod is ready to receive traffic. |
| `livenessProbe` | A YAML object configuring the [Kubernetes liveness probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#define-a-liveness-http-request) that controls when Kubernetes needs to restart the pod.|
| `volumes` | A YAML object representing a [pod volume](https://kubernetes.io/docs/concepts/storage/volumes). |
Expand Down Expand Up @@ -161,7 +161,7 @@ for a `RuntimeComponent` CR:
|--------------------------------|--------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `app.kubernetes.io/instance` | `metadata.name` | A unique name or identifier for this component. This cannot be modified. |
| `app.kubernetes.io/name` | `metadata.name` | A name that represents this component. |
| `app.kubernetes.io/managed-by` | `application-stacks-operator` | The tool being used to manage this component. |
| `app.kubernetes.io/managed-by` | `runtime-component-operator` | The tool being used to manage this component. |
| `app.kubernetes.io/component` | `backend` | The type of component being created. See OpenShift [documentation](https://github.com/gorkem/app-labels/blob/master/labels-annotation-for-openshift.adoc#labels) for full list. |
| `app.kubernetes.io/part-of` | `metadata.name` | The name of the higher-level application this component is a part of. Configure this if the component is not a standalone application. |
| `app.kubernetes.io/version` | `version` | The version of the component. |
Expand Down Expand Up @@ -517,7 +517,7 @@ This allows to automatically provision TLS certificates for pods as well as rout

Cert-manager installation instruction can be found [here](https://cert-manager.io/docs/installation/)

When creating certificates via the RuntimeComponent CR the user can specify a particular issuer name and toggle the scopes between `ClusterIssuer` (cluster scoped) and `Issuer` (namespace scoped). If not specified, these values are retrieved from a ConfigMap called `application-stacks-operator`, with keys `defaultIssuer` (default value of `self-signed`) and `useClusterIssuer` (default value of `"true"`)
When creating certificates via the RuntimeComponent CR the user can specify a particular issuer name and toggle the scopes between `ClusterIssuer` (cluster scoped) and `Issuer` (namespace scoped). If not specified, these values are retrieved from a ConfigMap called `runtime-component-operator`, with keys `defaultIssuer` (default value of `self-signed`) and `useClusterIssuer` (default value of `"true"`)

_This feature does not support integration with Knative Service._

Expand Down
Loading