Last active
May 31, 2019 13:34
-
-
Save welshstew/8d4eead56956b19a5e10d7a14328cab4 to your computer and use it in GitHub Desktop.
mssql on minishift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oc create secret generic mssql-secret --from-literal=MSSQL_SA_PASSWORD=sqladmin1! | |
oc create -f https://gist.githubusercontent.com/welshstew/8d4eead56956b19a5e10d7a14328cab4/raw/469416fcb5445cd9fef9c1c362d7ddffd9733882/mssql-server-template.yml | |
oc new-app --template=mssql-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oc new-project mssql | |
oc import-image mssql-server --from=mcr.microsoft.com/mssql/server:2019-CTP3.0-ubuntu -n openshift --confirm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: template.openshift.io/v1 | |
kind: Template | |
metadata: | |
name: mssql-server | |
objects: | |
- apiVersion: apps.openshift.io/v1 | |
kind: DeploymentConfig | |
metadata: | |
labels: | |
app: mssql-server | |
name: mssql-server | |
spec: | |
replicas: 1 | |
revisionHistoryLimit: 10 | |
selector: | |
app: mssql-server | |
deploymentconfig: mssql-server | |
strategy: | |
activeDeadlineSeconds: 21600 | |
rollingParams: | |
intervalSeconds: 1 | |
maxSurge: 25% | |
maxUnavailable: 25% | |
timeoutSeconds: 600 | |
updatePeriodSeconds: 1 | |
type: Rolling | |
template: | |
metadata: | |
labels: | |
app: mssql-server | |
deploymentconfig: mssql-server | |
spec: | |
containers: | |
- env: | |
- name: ACCEPT_EULA | |
value: "${ACCEPT_EULA}" | |
- name: SA_PASSWORD | |
valueFrom: | |
secretKeyRef: | |
key: MSSQL_SA_PASSWORD | |
name: mssql-secret | |
image: | |
imagePullPolicy: Always | |
name: mssql-server | |
ports: | |
- containerPort: 1433 | |
protocol: TCP | |
terminationMessagePath: /dev/termination-log | |
terminationMessagePolicy: File | |
volumeMounts: | |
- mountPath: /var/opt/mssql/data | |
name: mssql-data | |
dnsPolicy: ClusterFirst | |
restartPolicy: Always | |
schedulerName: default-scheduler | |
terminationGracePeriodSeconds: 30 | |
volumes: | |
- name: mssql-data | |
persistentVolumeClaim: | |
claimName: mssql-data | |
test: false | |
triggers: | |
- type: ConfigChange | |
- imageChangeParams: | |
automatic: true | |
containerNames: | |
- mssql-server | |
from: | |
kind: ImageStreamTag | |
name: mssql-server:latest | |
namespace: openshift | |
type: ImageChange | |
- apiVersion: v1 | |
kind: Service | |
metadata: | |
labels: | |
app: mssql-server | |
name: mssql-server | |
spec: | |
ports: | |
- name: 1433-tcp | |
port: 1433 | |
protocol: TCP | |
targetPort: 1433 | |
selector: | |
app: mssql-server | |
deploymentconfig: mssql-server | |
type: ClusterIP | |
- apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
labels: | |
app: mssql-server | |
name: mssql-data | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: 10Gi | |
parameters: | |
- description: 'Accept MS EULA' | |
displayName: ACCEPT_EULA | |
name: ACCEPT_EULA | |
value: "Y" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oc port-forward $(oc get pods -l app=mssql-server -o name) 1433:1433 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Forwarding from 127.0.0.1:1433 -> 1433 | |
Forwarding from [::1]:1433 -> 1433 | |
Handling connection for 1433 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment