0

I am using Windows 10 Docker Desktop and Powershell(version 5.1.x) to follow weblogic kubernetes operator to create weblogic domain https://oracle.github.io/weblogic-kubernetes-operator/quickstart/install/

I am able to pull the images for weblogic 12.2.1.3 as given below

REPOSITORY                                          TAG                 IMAGE ID            CREATED             SIZE
container-registry.oracle.com/middleware/weblogic   12.2.1.3            62ceff11b24b        8 weeks ago         1.18GB
oracle/weblogic-kubernetes-operator                 2.5.0               69a7a5fc7fa8        2 months ago        538MB
traefik                                             1.7.12              18471c10e6e4        11 months ago       71.7MB

But while executing below command : Grant the Helm service account the cluster-admin role.

$ cat <<EOF | kubectl apply -f -
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: helm-user-cluster-admin-role
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: default
  namespace: kube-system
EOF

I am getting error from Powerhell

At C:\Users\RANAJOYPAUL\Ranajoy\APMM\Git Hub repo\weblogic-kubernetes-operator\command.ps1:1 char:6
+ cat << EOF | kubectl apply -f -
+      ~
Missing file specification after redirection operator.
At C:\Users\RANAJOYPAUL\Ranajoy\APMM\Git Hub repo\weblogic-kubernetes-operator\command.ps1:1 char:5
+ cat << EOF | kubectl apply -f -
+     ~
The '<' operator is reserved for future use.
At C:\Users\RANAJOYPAUL\Ranajoy\APMM\Git Hub repo\weblogic-kubernetes-operator\command.ps1:1 char:6
+ cat << EOF | kubectl apply -f -
+      ~
The '<' operator is reserved for future use.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : MissingFileSpecification

I have tried to insert the whole command text inside a .ps1 file and execute the same but with same result. I dont have linux shell in my machine so please let me know how can I issue such commands from Powershell. Thanks in advance!!

Zoltan Ersek
  • 755
  • 9
  • 28
  • 2
    You are trying to use a [Bash heredoc](https://stackoverflow.com/a/2500451/503046) syntax in Powershell. Save the configuration in a text file and tell `kubectl` to read from a file instead of stdin. – vonPryz May 06 '20 at 06:34
  • Thanks I able to execute the same putting inside a yml file and execute the same as kubectl apply -f - <> – Ranajoy Paul May 07 '20 at 07:07

0 Answers0