Commit ed799b8b by WinDocks Committed by Guangbo

Add Windocks 1.5.0 (#195)

* Added Windocks v 1.5.0
parent e29784be
apiVersion: v1
appVersion: "1.5.0"
description: Windocks SQL Server containers
name: windocks
version: 1.5.0
home: https://www.windocks.com/
icon: https://windocks.com/img/windockslogo.png
sources:
- https://github.com/WinDocks/rancher
maintainers:
- name: WinDocks
email: support@windocks.com
Windocks SQL proxy
The Windocks SQL proxy delivers Windows SQL Server containers with database clones to a cluster. The proxy:
- Creates a Windows SQL Server container on a designated external machine that already has Windocks (cloud or on-prem)
- Clones terabyte sized SQL Server databases in seconds and delivers them to the container
- Proxies SQL traffic from the client applications (users, .Net apps, Sql Server Management Studio, NodeJs apps etc) to the Windocks container
- Enables the client applications to work on the cloned databases (usually production database clones)
- Deletes the Windocks SQL Server container when the SQL proxy pod / container is deleted
Pre-requisites
1. Windocks installed on a machine accessible to the cluster
2. For TLS connections, the required TLS setup on the Windocks machine and an SSL certificate and key for the proxy
Steps
1. Enter the values for proxy image name/tag and environment variables (Windocks host ip, Windocks server port, etc. ). Use the default values where provided
2. Create the auth secret: create secret generic proxy-secrets --from-literal=WINDOCKS_REQUIRED_USERNAME='windocks-api-username' --from-literal=WINDOCKS_REQUIRED_PASSWORD='windocks-api-password' --from-literal=WINDOCKS_REQUIRED_CONTAINER_SAPASSWORD='sa-password-to-set-for-windocks-container'
3. For TLS: Create a secret in a file with tls.key and tls.crt, both of which are mounted as files into the container. Separate coniguration is required on the Windocks server
4. Deploy the app and use SQL Server Management Studio or Azure Management Studio to connect to the <Windocks=host-IP>,3087 using SQL auth: sa and the password above
Email support@windocks.com for issues
\ No newline at end of file
categories:
- Database
- SQL Server
labels:
io.rancher.certified: partner
questions:
- variable: image.repository
default: "windocks/windocks-sql-server-proxy"
description: "Docker image name"
type: string
required: true
label: Image Name for Sqlproxy
group: "Sqlproxy Settings"
- variable: image.tag
default: "1.5.0"
description: "Image tag"
type: string
required: true
label: Image tag
group: "Sqlproxy Settings"
- variable: image.pullPolicy
default: "Always"
description: "Image pull policy"
type: enum
required: true
options:
- "Always"
- "IfNotPresent"
label: Image pull polcy
group: "Sqlproxy Settings"
- variable: sqlproxy.windocksServerHostname
default: "34.220.44.23"
description: "IP or hostname for Windocks server"
type: string
required: true
label: Windocks Server hostname
group: "Sqlproxy Settings"
- variable: sqlproxy.windocksServerPort
default: "3000"
description: "Port for Windocks API"
type: string
required: false
label: Windocks port
group: "Sqlproxy Settings"
- variable: sqlproxy.windocksImageName
default: "clone"
description: "Windocks image name from which SQL Server containers and database clones are created"
type: string
required: true
label: Windocks image name
group: "Sqlproxy Settings"
- variable: sqlproxy.windocksContainerName
default: ""
description: "Name to use for Windocks container created by Sqlproxy"
type: string
required: false
label: Windocks container name
group: "Sqlproxy Settings"
- variable: sqlproxy.windocksPersistentContainerPort
default: ""
description: "Set this if you do not want Sqlproxy to create and manage the Windocks container. You must create the Windocks container using the Windocks web app or a docker client"
type: string
required: false
label: Pre-existing Windocks container port
group: "Sqlproxy Settings"
- variable: sqlproxy.port
default: "3087"
description: "Container port for access to Windocks Sql proxy"
type: string
required: true
label: Sqlproxy listening port
group: "Sqlproxy Settings"
- variable: sqlproxy.authSecretName
default: ""
description: "Secret; WINDOCKS_REQUIRED_USERNAME='' WINDOCKS_REQUIRED_PASSWORD='' WINDOCKS_REQUIRED_CONTAINER_SAPASSWORD=''"
type: string
label: Secret for Windocks API user, passwd, and desired SQL sa password
required: true
group: "Sqlproxy Settings"
- variable: sqlproxy.tls
default: ""
description: "Set to true for TLS"
type: string
label: TLS connection
required: false
group: "Sqlproxy Settings"
- variable: sqlproxy.sslSecretName
default: ""
description: "Secret - in a file with tls.key:... and tls.crt:......"
type: string
label: Secret for ssl cert and key (files)
required: false
group: "Sqlproxy Settings"
- variable: sqlproxy.localHostNameForTls
default: ""
description: "For TLS connections, hostname for the sql proxy"
type: string
label: For TLS connections, hostname for sql proxy service
required: false
group: "Sqlproxy Settings"
- variable: service.port
default: "3087"
description: "Service port for access to Windocks Sql proxy"
type: string
label: Windocks SQL proxy NodePort number
required: true
group: "Sqlproxy Settings"
- variable: service.loadBalancerIP
default: ""
description: "Load balancer IP"
type: string
label: Load balancer IP
required: false
group: "Sqlproxy Settings"
- variable: service.type
default: "ClusterIP"
description: "MySQL K8s Service type"
type: enum
group: "Services and Load Balancing"
options:
- "ClusterIP"
- "LoadBalancer"
- "NodePort"
required: true
label: Sqlproxy Service Type
\ No newline at end of file
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range .Values.ingress.hosts }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "windocks-sql-proxy.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc -w {{ template "windocks-sql-proxy.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "windocks-sql-proxy.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "windocks-sql-proxy.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:80
{{- end }}
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "windocks-sql-proxy.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "windocks-sql-proxy.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "windocks-sql-proxy.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ template "windocks-sql-proxy.fullname" . }}
labels:
app: {{ template "windocks-sql-proxy.name" . }}
chart: {{ template "windocks-sql-proxy.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "windocks-sql-proxy.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "windocks-sql-proxy.name" . }}
release: {{ .Release.Name }}
spec:
{{- if contains "true" .Values.sqlproxy.tls }}
volumes:
- name: proxy-secret-ssl
secret:
secretName: {{ .Values.sqlproxy.sslSecretName }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: tcp-proxy
containerPort: {{ .Values.sqlproxy.port }}
protocol: TCP
envFrom:
- secretRef:
name: {{ .Values.sqlproxy.authSecretName }}
env:
- name: WINDOCKS_REQUIRED_HOSTNAME
value: {{ .Values.sqlproxy.windocksServerHostname | quote }}
- name: WINDOCKS_OPTIONAL_PORT
value: {{ .Values.sqlproxy.windocksServerPort | quote}}
- name: WINDOCKS_REQUIRED_IMAGE_NAME
value: {{ .Values.sqlproxy.windocksImageName | quote}}
- name: WINDOCKS_SQL_PROXY_OPTIONAL_LISTENING_PORT
value: {{ .Values.sqlproxy.port | quote}}
- name: WINDOCKS_SQL_PROXY_OPTIONAL_LOCAL_HOSTNAME_FOR_TLS
value: {{ .Values.sqlproxy.localHostNameForTls | quote }}
- name: WINDOCKS_SQL_PROXY_OPTIONAL_TLS
value: {{ .Values.sqlproxy.tls | quote}}
# - name: WINDOCKS_OPTIONAL_CONTAINER_NAME
# value: {{ .Values.sqlproxy.windocksContainerName }}
# If WINDOCKS_OPTIONAL_PERSISTENT_CONTAINER_PORT is set, then the proxy will not create or delete the Windocks container.
# - name: WINDOCKS_OPTIONAL_PERSISTENT_CONTAINER_PORT
# value: {{ .Values.sqlproxy.windocksPersistentContainerPort }}
{{- if contains "true" .Values.sqlproxy.tls }}
volumeMounts:
- mountPath: "/usr/src/app/ssl"
name: proxy-secret-ssl
readOnly: true
{{- end }}
#livenessProbe:
#tcpSocket:
#port: {{ .Values.sqlproxy.port }}
#readinessProbe:
#tcpSocket:
#port: {{ .Values.sqlproxy.port }}
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "windocks-sql-proxy.fullname" . -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
app: {{ template "windocks-sql-proxy.name" . }}
chart: {{ template "windocks-sql-proxy.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $fullName }}
servicePort: http
{{- end }}
{{- end }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "windocks-sql-proxy.fullname" . }}
labels:
app: {{ template "windocks-sql-proxy.name" . }}
chart: {{ template "windocks-sql-proxy.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
sessionAffinity: ClientIP
type: {{ .Values.service.type }}
{{- if and (hasKey .Values.service "loadBalancerIP") (eq .Values.service.type "LoadBalancer") }}
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
{{- end }}
ports:
- port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort }}
protocol: TCP
name: tcp
selector:
app: {{ template "windocks-sql-proxy.name" . }}
release: {{ .Release.Name }}
# Default values for windocks-sql-proxy.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: windocks/windocks-sql-server-proxy
tag: 1.5.0
pullPolicy: Always
service:
type: LoadBalancer
port: 3087
securePort: 3088
targetPort: 3087
targetSecurePort: 3088
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
path: /
hosts:
- chart-example.local
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
nodeSelector: {}
tolerations: []
affinity: {}
sqlproxy:
port: "3087"
windocksServerHostname: "34.220.44.23"
windocksServerPort: "3000"
windocksImageName: "clone"
# windocksContainerName: "mycontainername"
# windocksPersistentContainerPort; "10122"
# windocksPersistentContainerPort is the port on which the proxy expects the pre created Windocks container
tls: "false"
localHostNameForTls: ""
# Secret names
authSecretName: proxy-secrets
sslSecretName: proxy-secret-ssl
# kubectl create secret generic proxy-secrets --from-literal=WINDOCKS_REQUIRED_USERNAME='user' --from-literal=WINDOCKS_REQUIRED_PASSWORD='pass' --from-literal=WINDOCKS_REQUIRED_CONTAINER_SAPASSWORD='sapass'
# kubectl create -f file-that-contains-tls.key-and-tls.crt-and-name-proxy-secret-ssl
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment