Skip to content

Commit

Permalink
Updated deployment files to modernize for newer Kube networking deplo…
Browse files Browse the repository at this point in the history
…yment spec
  • Loading branch information
chobbs committed Nov 23, 2021
1 parent 8399f3d commit cdfbc46
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
27 changes: 14 additions & 13 deletions kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,30 +71,24 @@ kubectl apply -f mysql-deployment.yaml

### Ingress Controller

For this example, we are using Nginx as an ingress controller, which allows us to use the sticky sessions. Sticky sessions is required for clustered Rundeck.
For this example, we are using Nginx as an ingress controller, which allows us to use the sticky sessions. Sticky sessions is required for clustered Rundeck. You will need to install it in order to make this example works (see https://github.com/kubernetes/ingress-nginx):

We are using this ingress controller: https://kubernetes.github.io/ingress-nginx/
You will need to install it in order to make this example works (see https://kubernetes.github.io/ingress-nginx/deploy/):


* First, install the common Nginx components. This is mandatory for any Nginx ingress on Kubernetes.
On a local Docker Desktop environment:

```
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/cloud/deploy.yaml
```

* Next, run the provider specific steps for Nginx ingress (see https://kubernetes.github.io/ingress-nginx/deploy/)
* If you are running this in a cloud, bare-metal, or other environment, please refer to the documentation link and choose your provider specific setup for Nginx ingress .(see https://kubernetes.github.io/ingress-nginx/deploy/)

On a local Docker Desktop environment:
After the Ingress is all setup, run the folling to wait until is ready to process requests:

```
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/cloud-generic.yaml
kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=90s
```

If you are running this in a different environment, please refer to the documentation linked above.

### Create Rundeckpro deployment

The required Rundeck configuration options are already set in this file. Please read and review it to make sure it fits your intended purpose, or add to it if necessary.
Expand All @@ -104,6 +98,13 @@ kubectl apply -f rundeckpro-deployment.yaml
```

### Access Rundeck WebUI

You will need to port-forward the Rundeck service to access and interact with WebUI running in your Kubernetes cluster from your localhost.

```
kubectl port-forward service/rundeckpro 8080:8080
```

## Uninstall

Expand All @@ -116,4 +117,4 @@ kubectl delete deployment,service minio
kubectl delete job minio-create-bucket
```

Note: These delete commands leave the persistent volumes and secrets in place so you can start up the environment again rather easily.
Note: These delete commands leave the persistent volumes and secrets in place so you can start up the environment again rather easily.
29 changes: 14 additions & 15 deletions kubernetes/rundeckpro-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
apiVersion: networking.k8s.io/v1beta1
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: rudeckpro-nginx
annotations:
kubernetes.io/ingress.class: "nginx"
#for sticky sessions
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingres.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/session-cookie-name: "route"
nginx.ingress.kubernetes.io/session-cookie-expires: "172800"
nginx.ingress.kubernetes.io/session-cookie-max-age: "172800"

spec:
ingressClassName: nginx
rules:
- host: localhost
http:
paths:
- backend:
serviceName: rundeckpro
servicePort: 8080
path: /

- path: /
pathType: Prefix
backend:
service:
name: rundeckpro
port:
number: 8080
---

apiVersion: v1
Expand All @@ -39,15 +39,15 @@ spec:

---

apiVersion: apps/v1
apiVersion: apps/v1
kind: Deployment
metadata:
name: rundeckpro
namespace: default
labels:
app: rundeckpro
spec:
replicas: 2
replicas: 1
selector:
matchLabels:
app: rundeckpro
Expand All @@ -71,7 +71,7 @@ spec:
subPath: config
env:
- name: RUNDECK_GRAILS_URL
value: "http://localhost"
value: "http://localhost:8080"
- name: RUNDECK_DATABASE_DRIVER
value: "org.mariadb.jdbc.Driver"
- name: RUNDECK_DATABASE_URL
Expand Down Expand Up @@ -154,5 +154,4 @@ spec:
secretName: kubeconfig
items:
- key: config
path: config

path: config

0 comments on commit cdfbc46

Please sign in to comment.